firefox-addon

Is it possible to use Google Gears inside of another Firefox extension?

Basically, i want to implement Offline/Online XUL application with ability to upload data to server. Yes, i know there is Mozilla Storage API, but it looks like it is much more easier with Gears to have local database and to upload local changes to server using WorkerPool. Without Gears, i have no ideas how to upload local changes to r...

iFrame in Firefox hidden window with a contentWindow.history?

I'm trying to run a hosted script with content privileges in my Firefox extension. To do this, I create a content iframe in the hidden window pointed at a html file that pulls the script. This script requires the 'history' be available, but the iframes created in the hidden window have no history for some reason. Chromebug reports this ...

Creating a notification system using a firefox extension

I am creating a firefox extension that should give a notification when the user hits specific sites. I do not want the same kind of notification that firefox gives for pop-ups. I don't want the user to have to go through the hassle of clicking the X in order to close the notification. Instead, I would like it to look like what happens wh...

turning on Greasemonkey live editing

On Firefox, I click Tools, Addons, Extensions, Greasemonkey, Options, select my user script, click Edit, change the source code, click save, reload one of the included pages, but the script is the unchanged version. On User Scripts, logged in, I click my username, Script Management, my script's name, Admin, Edit Code Online, change the ...

Change save to file name but from the client

This question asks about file name the servers sends and the fix was quite simply a content-disposition header in the http response. What I interested in is does anyone know of any way to do this from the client side if the file name is already known? Is there any special javascript to do this for example? A site I have to use but not ...

How can I give some basic text editing functionality to a firefox plugin?

Hello. I'm writing a plugin to Firefox, which is basically a sidebar, that is filled with yaml-formatted information based on what user does on the page (just another web testing solution). I want to enable user to change generated text manually right in the sidebar and: Add code-folding (folding click: \n text: some text to a single l...

Accessing XUL anonymous content using C++

Hi All, I am writing Firefox extension using C++. I am trying to access XUL:tabox element in "TabOpen" event handler, but I am unable access any XUL element. I am putting here pseudocode of my extension for reference: HandleEvent() { if (event type is TabOpen) { nsCOMPtr<nsIDOMNode> OriginalNode = do_QueryInterface(event...

how to attach window.close to cntrl+w keypress event in a xul window?

I have a XUL window, and I want the cntrl+w hotkey to close the window, but when I attach: window.addEventListener("keypress", function(ev) { GM_log("onkeypress handler: \n" + "keyCode property: " + ev.keyCode + "\n" + "which property: " + ev.which + "\n" + "charCode property: " + ev.charCode + "\n" + "Character Key Pressed: "...

Using Components.utils.import in a firefox extension

I am trying to create some global variables in a firefox extension. In my content folder, I have two javascript files: 1) Main JS file that holds the functions for the different events, etc 2) A file that stores only an object with the pieces of state I want to maintain. Also, I set the array EXPORTED_SYMBOLS. I am having issues with ...

Firefox Extension needs to get cookie from PHP redirected external page.

I am writing a firefox extension that interacts with a JSON server interface. I receive a url to the server which then redirects to the client site that provides the cookie. I need to be able to set this cookie in the users browser without physically loading it in the browser. Is this possible through an AJAX call? I tried using a hi...

[Ffx extension] File download

Is there any way I can make Firefox call a JS function in my extension whenever it completes a download (passing the path of the downloaded file)? Thanks for any help. ...

Getting tab URL in C++

Hi, I am writing Firefox extension using C++. I am enumerating the tabs to get their respective URLs. Following is pseudocode: nsCOMPtr<nsIWindowMediator> windowMediator = do_GetService(NS_WINDOWMEDIATOR_CONTRACTID, &rv); windowMediator->GetMostRecentWindow(L"navigator:browser", getter_AddRefs(dwi)); dwi->GetDocument(getter_AddRefs(d...

Blank responseText in XMLHttpRequest when running in custom protocol in FireFox?

I am writing a FireFox add-on that displays webpages from my server as control and info panels. These panels were written and work in regular URLs, but when I try to access them through a custom protocol (so it's like about:, just myplugin:settings) every XMLHttpRequest returns blank as if I was doing XSS stuff. I know the data's getti...

[JS] XMLHttpRequest problem

I am trying to do "POST" with XMLHttpRequest in a firefox extension, and after that I try to get the "Location" header and open it in a new tab. For some reason, the XMLHttpRequest doesn't contain a location header. My code function web(url,request) { var http = new XMLHttpRequest(); http.open('POST',url,true); http.setReq...

HTML in new tab

Can someone explain to me how can I open a new tab from a firefox extension, that contains HTML content from a string I have? ...

Write an add-on or greasemonkey script to "Ajaxify" webpages in Firefox?

Hello. I stumbled upon this add-on which "Ajaxifies" parts of its target website. https://addons.mozilla.org/en-US/firefox/addon/51789 I have a similar need like this. I want only part of the webpage's DOM to update upon receiving click on a link, since the website has a rather unified page layout. I have no experiences in writing FF...

Setting span html element text in C++

Hi, I am writing firefox extension using C++. I want to set text of the span html element. In Javascript, I used 'textcontent' javascript property to set span element text. How can I do it in C++? I found nsIDOMHTMLElement interface & its child interfaces. They seem useful. I am not getting the way in which I will use nsIDOMHTMLEle...

nsIDOMNSHTMLElement IID change

Hi, I am writing Firefox extension which would be compatible with Firefox's 3.0 to 3.6 versions. I am using nsIDOMNSHTMLElement interface pointer for setting inner text of html element. I am getting nsIDOMNSHTMLElement interface pointer by calling QI on nsIDOMElement But IID of nsIDOMNSHTMLElement changes from Firefox's 3.0 to 3.6 ve...

How to Configure SSL inside Firefox extension?

Hi, Can anybody explain how SSL can be configured inside a Firefox extension? I have a client who wants to connect to an https server and download some contents. My problem here is I don't know how to configure the communication between the client and the server inside the extension. I would appreciate if somebody would explain this to...

XMLHttpRequest - JSON - .NET

I am trying to send JSON from my mozilla addon to my asp.net page. var myJSONObject = {"userName": una,"password": pass}; request = new XMLHttpRequest(); request.open("GET","http://www.google.com?jo=" + myJSONObject,true, null, null); on my .net page I have tried several ways of doing it but not able to find the best way...