xpcom

Accessing Firefox cache from an XPCOM component

落爺英雄遲暮 提交于 2019-12-08 00:13:46
问题 Does anybody know how to get local path of file cached by Firefox based on its URL from an XPCOM component? 回答1: To access cached items, new cache session must be created using createSession method provided in nsICacheService . This method creates nsICacheSession object. Information about cache item can be obtained using openCacheEntry method of the session object (method return nsICacheEntryDescriptor ). To read data user must open input stream using openInputStream method of the cache entry

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

拥有回忆 提交于 2019-12-07 15:39:36
问题 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

getElementById for XML Documents, Mozilla extensions

[亡魂溺海] 提交于 2019-12-07 15:05:22
问题 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(

How to stop firefox from downloading and applying CSS via a firefox extension?

巧了我就是萌 提交于 2019-12-07 13:16:25
Thanks to everyone in advance - So I have been banging on this issue for quite a while now and have burned through all my options. My current approach to canceling css requests is with nsIRequest.cancel inside of nsIWebProgressListener.onStateChange. This works most of the time, except when things are a little laggy a few will slip through and jump out of the loadgroup before I can get to them. This is obviously a dirty solution. I have read through the following links to try and get a better idea of how to disable css before a nsIRequest is created...no dice. https://developer.mozilla.org/en

replace nsICertificateDialogs from firefox extension

随声附和 提交于 2019-12-07 08:47:22
问题 I'm trying to replace the nsICertificateDialogs dialog with my own implementation. I already have an extension that handles smime mails from webmail. I want to be able to use the Mozilla cert store with my extension. The only possibility I've found to export smime certs/keys (to use it in my extension) is via exporting a pfx file. I unregistered the original certifica tedialog and registered mine as described here Failure while calling nsIX509CertDB.nsIX509CertDB from command line (unregister

What is whitelist and blacklist data?

孤街醉人 提交于 2019-12-06 18:35:09
问题 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.. 回答1: 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,

Chrome and XPCOM

江枫思渺然 提交于 2019-12-06 10:36:17
Вoes Chrome have an equivalent to XPCOM? No, it doesn't. Extensions and plugins can only interact with the browser through their respective APIs. No. Mozilla implements its many fundamental components (browser, network, string, window, etc) libraries in XPCOM such that C++ and JavaScript can re-use, invoke, and override those APIs. Therefore many firefox addons can take advantages of this and build powerful features in JavaScript with XPCOM. However, in Chrome or WebKit, there is no such equivilant components. Their extensions can only call their browser built-in APIs. 来源: https:/

What is missing that I get an NS_BASE_STREAM_CLOSED error?

拥有回忆 提交于 2019-12-06 08:11:04
I just recently joined a website project. In order to work on it, I cloned the git repo and set up a fresh LEMP stack on a VPS to serve the page. It took a surprising amount of work to get the thing running (my first attempt had been on a laptop on it wouldn't even serve the first index.php properly). I've now got it to show the homepage and everything but a font seems to load up alright. There are a number of links that go to dynamically generated pages. On the final product, these will be created with fresh data; for now the data is just pulled from a database so that we can tweak how it's

Accessing Firefox cache from an XPCOM component

孤街醉人 提交于 2019-12-06 07:42:15
Does anybody know how to get local path of file cached by Firefox based on its URL from an XPCOM component? To access cached items, new cache session must be created using createSession method provided in nsICacheService . This method creates nsICacheSession object. Information about cache item can be obtained using openCacheEntry method of the session object (method return nsICacheEntryDescriptor ). To read data user must open input stream using openInputStream method of the cache entry object. 来源: https://stackoverflow.com/questions/61453/accessing-firefox-cache-from-an-xpcom-component

How to preprocess HTML before it's loaded and parsed by Mozilla?

江枫思渺然 提交于 2019-12-06 06:39:55
I need a way to process HTML before it's actually loaded and parsed by Mozilla. Is there any content listener that I can use in my Firefox extension? Add an Event Listener to the gBrowser global object, making sure to set usecapture to true. You could also intercept the response . Do you mean something like greasemonkey ? Sorry, I don't know enough about Firefox extensions. The Greasemonkey website is blocked here in China and my VPN does not work at the moment, but maybe they are open source. Then you can see what they do, if writing a greasemonkey skript is not what you want. 来源: https:/