firefox-addon

Javascript regex in firefox extension

What could be going wrong here? The problem seems to be with the regex match statement. without it the alerts come, but as soon as I put it in everything goes quiet. Thanks so much! the wildcard is simply to help pinpoint the problem, it is NOT the objective, i do need regex. window.addEventListener("load", function() { myExtension.init...

Firefox logs invalid URL?

I'm writing an extension for firefox. Using dom.location to keep track of visited search results pages, i'm getting this url http://www.google.com/search?hl=en&source=hp&q=hi&aq=f&aqi=&oq=&fp=642c18fb4411ca2e . If you click it, the google search results for "hi" should come up. You'll know that from the title bar ...

Altering HTTP Responses in Firefox Extension

How can I alter the HTTP response body in a Firefox extension? I have setup an http-on-examine-response observer and an nsIStreamListener object with the code below. After I get the data, parse it, and alter it, how do I push the altered response back to the firefox browser? For example, let's say I go to Google.com with my extension ena...

rendering web page as thumbnail

Hi, I asked this question earlier, since i am a little new to firefox extension development, the canvas thing for firefox went a little over my head. Apologies for reposting this again. with the first answer there was this code snippet: var path = this.getPref("path","string"); what are the path and string? yes i did look up for get...

What does this code (from a Mozilla Add-on tutorial) do?

var Helloworld = { onLoad: function() { // initialization code this.initialized = true; }, onMenuItemCommand: function() { window.open("chrome://helloworld/content/hello.xul", "", "chrome"); } }; window.addEventListener("load", function(e) { Helloworld.onLoad(e); }, false); http://kb.mozillazine.org/Getting%5Fstar...

Calling Javascript function from XPCOM, C++

Hi, My goal is to catch pageloads in my component, insert some javascript into the document and then catch onFocus events. On an event i then want to call the javascript function i injected. Now i managed to solve most issues, i have the script added to all webpages and i can catch onfocus events. What im not able to do is execute a ja...

retrieving the image saved on the local drive using canvas drawWindow

Hi, In the previous post I rendered the webpage as image and i saved scaled the image to thumbnail and saved it on my c://. I have a collection of links that i ahve appended on a frame. So when the user hovers the mouse over these links i want the images that i saved earlier (C:/) to popup. so is there way to source the image from c:/...

Open links in new tab in Firefox

I am developing an Firefox extension. How can all the links on a webpage to be opened in a new tab? ...

Getting the full url for an image in webpage

I would like to get the full url of an image in a web page. The image is used as a background image. I was using Firebug's inspect feature. In the CSS view, it shows url(/images/myimage.gif) for the background-image element. Is there a way to display the full url? ...

program a Firefox extension to download a page

I want to apply a regex to a page whose URL only my extension is going to know. How do I program a Firefox extension to download the page? ...

Firefox Addon Development : Detecting non-compatible addons ?

Few addons are not compatible with mine, so how to detect their presence and inform the user. Thanks ...

Duplicate event listeners when multiple windows are open (Firefox extension)

My firefox extension calls an observer function on load that intercepts http requests (http-on-modify-request) from certain domains and opens them in a new tab. The issue I'm having is that if multiple browser windows are open (not tabs, but new browser windows), then the JS for my extension is executed multiple times, and as a result, ...

Accessing tabs on Firefox with a C++ XPCOM extension

What XPCOM interfaces should I use to detect opening, closing and switching of tabs and also get their associated URL from a firefox extension? I have seen instances of code that manage tabs in JS, but how about from C++ ? ...

Which tool to use to develop toolbar for Internet Explorer and Firefox?

Hi there, I want to develop toolbar for Internet Explorer and Firefox. Is there any common tool? If not, which tool can be used? Thanks for reading. Regards, Sanket ...

Why does this XUL code works and the Javascript equivalent doesn't?

xul way: <toolbar id="PersonalToolbar"> <toolbarbutton id="Testing-Doit-Button2" class="bookmark-item pagerank" tooltiptext="Do it!" oncommand="testing_doit();" /> </toolbar> javascript way: function createBookmarkItem() { const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; va...

I add 10 functions to a code, I don't even call any of them, but the code stops working!

Alone, this code works: CustomButton = { 1: function () { alert("Just testing") }, } I add the code below and the code above stops working: function getvisitingnow() { return document.location; } function getcontents(uri) { var req = new XMLHttpRequest(); req.open('GET', uri, true); req.onreadystatechange = function (aEvt)...

Setting HTTP Headers form a Firefox Extension

How can I set HTTP headers in my firefox extension? I'll make it so these are only sent while hitting my site so I can detect if the plugin is installed or not and not promote the plugin if it is. Thanks! ...

Accessing the Firefox object model

Is it possible to access the DOM of a firefox page from a process outside of Firefox (in Windows.) It is possible to do with in IE via the accessibility interface and is a commonly used technique to access the IE browser without installing a BHO. But I was wondering if there is a similar technique available for Firefox, or must I install...

Google Analytics to track FireFox extension use

I'm developing a Firefox extension and would like to track its use with google analytics, but I can't get it working. I've tried manually calling a funstion from ga.js, but that didn't work for some reason. No error was produced, but neither was any data collected. My last attempt was to have a website that just holds the tracking java...

getElementById("bookmarksBarContent").appendChild(button) is interpreted as getElementById("PersonalToolbar").appendChild(button)

"At the moment you can't overlay an element without an ID, so you need to use DOM methods to tweak the element you need in a load handler." - Xul Overlays I'm trying! For record: Using the Javascript Shell means using Firefox -> Tools -> ExtensionDeveloper -> Javascript Shell -> enumerateWindows() -> chrome://browser/content/browser.xu...