xpcom

SQLite Storage in Firefox 3.0 +

匆匆过客 提交于 2019-12-10 21:38:48
问题 I have a Firefox extension that supports Firefox 3+, and SQLite database is important for my extension. I saw on the MDN that the API might change and it`s "unfrozen", should I be worried about it? The API is currently "unfrozen", which means it is subject to change at any time; in fact, it has changed somewhat with each release of Firefox since it was introduced, and will likely continue to do so for a while. 回答1: This warning is probably outdated, it has been added to the original version

How does someone use thirdparty libraries to be included in Firefox addons/extensions?

雨燕双飞 提交于 2019-12-10 18:31:38
问题 I am currently learning how to create Firefox addons using XPCOM and I want to know how to include thirdparty libraries to develop them. I followed a few tutorials to compile .xpt and .dll from c++ files (noted in: https://developer.mozilla.org/en/How_to_build_a_binary_XPCOM_component_using_Visual_Studio and http://nerdlife.net/building-a-c-xpcom-component-in-windows/) and I am not sure how we are suppose to include the files into an addon project (which gets packaged into .xpi file). I am

How to manipulate window prototype in a <browser> element?

本秂侑毒 提交于 2019-12-10 12:08:38
问题 What I'm doing right now is: When <browser src="..." /> loads, I attach data into its .contentWindow : frame.addEventListener("load",function(){ this.contentWindow.someMethod = function(){}; },true); Now I want to know if there is a way to do this earlier, into the <browser> 's window prototype, or any Window prototype, as for example I can do in the "current" window: // [W]indow is the constructor Window.prototype.test = function(){ alert("hello"); }; // [w]indow is the instance window.test(

How to access a SQLite database inside the data directory in add on builder

我与影子孤独终老i 提交于 2019-12-10 11:53:57
问题 Is there any way to access a SQLite database inside the Data directory in the add-on builder using add-on sdk v1.5? this is the code that i am using: var {Cc, Ci, Cu} = require("chrome"); var data = require('self').data; // This is an active module of the pankajsingh5k Add-on exports.main = function() { var {Services} = Cu.import("resource://gre/modules/Services.jsm"); var {FileUtils} = Cu.import("resource://gre/modules/FileUtils.jsm"); var file = FileUtils.getFile("Desk", "Helper.sqlite");

Firefox extension: Cancel requests and emit fake responses

浪尽此生 提交于 2019-12-09 04:17:11
问题 I am trying to develop a Firefox extension that drops every HTTP request to a certain site and returns a fake response. No request should get through to the original web server, but I want to be able to create a custom response. I tried to intercept the "http-on-modify-request" message, but cancelling the request doesn't seem to work, as I cannot simulate a real response afterwards. Similarly, using an nsITraceableStream instance, I don't seem to be able to really cancel the request. I am out

Stream canvas to imgITools to make ico

时光怂恿深爱的人放手 提交于 2019-12-08 12:20:26
问题 So on WinXP I have been having a hard time converting a PNG file to an ICO with canvas. I found this method encodeImage . I don't know if it works but it looks promising but I can't figure out how to feed the image I drew on a canvas into imgITools.decodeData . What should I use for aImageStream and/or aMimeType ? imgTools.decodeImageData(aImageStream, aMimeType, imgContainer); This is more of my code: img['asdf'].file = new FileUtils.File(myPathHere); let iconStream; try { let imgTools = Cc[

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

大憨熊 提交于 2019-12-08 05:07:53
问题 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

Chrome and XPCOM

旧街凉风 提交于 2019-12-08 02:37:50
问题 Вoes Chrome have an equivalent to XPCOM? 回答1: No, it doesn't. Extensions and plugins can only interact with the browser through their respective APIs. 回答2: 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

What is missing that I get an NS_BASE_STREAM_CLOSED error?

余生颓废 提交于 2019-12-08 01:48:35
问题 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

How to access nsIHTMLEditor interface in GeckoFX?

耗尽温柔 提交于 2019-12-08 00:27:11
问题 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