xpcom

How to access nsIHTMLEditor interface in GeckoFX?

孤街醉人 提交于 2019-12-06 04:37:53
I am trying to make a WYSIWYG HTML-editor by embedding GeckoFX in a Windows Forms application in VB.NET. The code goes like this: Dim Gbrowser As New GeckoWebBrowser Gbrowser.Navigate("about:blank") ... Gbrowser.Navigate("javascript:void(document.body.contentEditable='true')") How can I activate and access the nsIHTMLEditor interface from within my application? Thank you. UPDATE This code does not work: Dim hEditor As nsIHTMLEditor hEditor = Xpcom.GetService(Of nsIHTMLEditor)("@mozilla.org/editor/htmleditor;1") hEditor = Xpcom.QueryInterface(Of nsIHTMLEditor)(hEditor) hEditor.DecreaseFontSize(

How to place a Xul window as “Always On Top”?

倖福魔咒の 提交于 2019-12-06 04:36:24
I found this file at google code with the function: function SetAlwaysOnTop() { var chkTop = document.getElementById("itmAlwaysOnTop"); var xulWin = window.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIWebNavigation).QueryInterface(Ci.nsIDocShellTreeItem) .treeOwner.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIXULWindow); if(chkTop.getAttribute("checked") == "true") { xulWin.zLevel = xulWin.raisedZ; } else { xulWin.zLevel = xulWin.normalZ; } } The parts of it that I need are just: var xulWin = window.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci

getElementById for XML Documents, Mozilla extensions

最后都变了- 提交于 2019-12-06 01:17:27
Is document.getElementById method supported on DOM parsed from XML strings using the DOMParser method in Mozilla? I am making a Mozilla extension that reads an XML file and uses DOM Parser to convert the XML into a DOM element and tries getting elements by Id. The method getElementsByTagName works but not getElementById. It always returns null. function (xmlString) { var parser = new DOMParser(); var doc = parser.parseFromString(xmlString, "text/xml"); var aNodes = doc.getElementsByTagName("nodeTag"); for(var i=0; i<aNodes.length; ++i) { var id = aNodes[i].getAttribute('id'); var resultNode =

Expose an XPCOM component to javascript in a web page

风流意气都作罢 提交于 2019-12-05 22:39:23
I'd like to write a XPCOM component that gets exposed as a javascript object in a web page. Something like Google Gears is what I'm seeking. That is, after installing the Google Gears Firefox extension, the javascript object 'google.gears' is available to any web page that wants to use it. I've found lots of mozilla documentation on XPCOM development, but nothing on exposing the component to javascript running in a web page. Is this possible with XPCOM? Do I need to write a Firefox plug-in instead of an extension? I'm doing exactly that with a new API in Firefox 4 -

Using Java/Python libraries in programming Firefox/Chrome Extensions

坚强是说给别人听的谎言 提交于 2019-12-05 02:51:05
问题 I have an idea of studying user behavior on the browser, for which I intend to make a Chrome/Firefox extension to study the behavior dynamically. I have some predefined libraries in Java and Python to analyze the results, which will be impossible to program in plain JavaScript. Now for my question: is it possible to use third party libraries, especially those of Python or Java like plain function calls? I have a vague idea about something like Java XPCOM or PyXPCOM for Firefox. However, for a

What is XPCOM? XPCOM vs COM?

喜欢而已 提交于 2019-12-05 01:10:15
问题 I have trouble understanding XPCOM. How is it different from COM? What makes it cross platform? Is it a framework with a set of libraries that you can use to do some jobs? Also, does Component Object Model means every functionality is implemented in component so we can use it without knowing the detail implementation? Can you someone help me understand this please? Thanks, Chan. 回答1: I have trouble understanding XPCOM. How is it different from COM? XPCOM is Mozilla's own, cross-platform

What is whitelist and blacklist data?

ε祈祈猫儿з 提交于 2019-12-04 22:31:51
I was reading about development of XPCOM component. I came across these terms called whitelist data and blacklist data, I tried to find out on google but couldn't .. I do not know how its related to programming so forgive me if I placed the question at wrong place.. White lists and black lists are two ways of filtering data. If you have a white list then you will filter in only data on the white list; if you have a black list you will filter out only data on that list. For example, consider automatically rejecting incoming phone calls. You could have a black list of marketing companies, so

How can I monitor a file asynchronously in Firefox?

£可爱£侵袭症+ 提交于 2019-12-04 15:34:54
I want to monitor a plain text file on windows machine for changes to it. Whenever external application updates the file, my add-on is supposed to read it and act accordingly. Going through quite bit of documentation I could not find a direct facility to do this in Firefox. So I came up the following approaches. Please suggest. Approach 1 - In a while loop { a) List all the files in the directory being monitored / Use nsIFile.exists() b) If files does exist go to next step else go to sleep c) use "nsIFile" interface and obtain the attribute "lastModifiedTime" of the file & compare it with

How to overwrite built in XPCOM component in Firefox addon?

老子叫甜甜 提交于 2019-12-04 13:16:25
问题 I'm taking a foray into Firefox extension development for the first time, and so far it's been pretty comfortable going, but I'm running into a problem; one of the things I need to do overwriting the built-in nsIPromptService and replacing it with something of my own instead. I walked through the basic XPCOM component creation tutorial here and got the hello world one working: https://developer.mozilla.org/en/creating_xpcom_components And everything in that seems to work fine, but nothing I

How to implement XPCOM component (nsIContentPolicy) in bootstrapped Firefox extension

自古美人都是妖i 提交于 2019-12-04 07:38:56
I have a bootstrapped extension for Firefox. And now I want to implement nsIContentPolicy XPCOM component. I wrote a component module code. And now I want to register this component. The reason I want to register component is that I want to add my component to nsICategoryManager.addCategoryEntry with "content-policy" category. var {Cc, Ci, Cu} = require("chrome"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); //console.error("Running interceptor"); function Interceptor() } Interceptor.prototype = { classDescription: "DeferredTo HTTP requests Interceptor", classID: "{B5B3D9A0-08FC-11E3