firefox-addon

Can I call other methods in other javascript files from my overlay script?

I am writing a Firefox extension. I have setup an overlay for chrome://browser/content/browser.xul and I am handling the on load event. This I have working. I also have N separate .js files in my extension (specifically in chrome://my-extension/content/js/*.js). Each of these .js files implements a common interface. For example, fo...

Using JSON in XUL <template>s

As far as I can tell, the template feature in XUL doesn't allow you to load JSON data into your listbox/tree/etc. element. -- it only supports XML and RDF. The closest thing I found to an indication that it might someday support JSON, is the comments on this blog post from 2007, saying that there was a bug filed. But the bug in question ...

javascript how greasemonkey works

I read "Dive into Greasemonkey" written in 2005. It mentions that Greasemonkey wraps a user script in an anonymous function wrapper. Does Greasemonkey insert the wrapper into the source JavaScript code or add it as any event handler such as window.onload? ...

How to invoke an asp.net method using firefox addon poster?

hi, I have a method with signature public int create(string name, string loc) { } in Default.aspx page codebehind,which will accept name,loc as parameters then creates a record in the DB with those values and returns the id of the newly created record. I am trying to make a http post request to it using "Poster" with t...

barcode scanner in JavaScript? Or plugin/extension

Hi All, I'm looking at writing a USB barcode scanner interface to a web application (offline app). By this I mean that the scanner will be on the client machine not server. So I was wondering what the best design would be. I know I could write an ActiveX object or native plugin into some browser but this is not ideal, does anyone kno...

toggling fullscreen mode with javascript with firefox add-on

The firefox add-on I am working on is best viewed in fullscreen mode. (I am not creating a new window, but I insert a transparent div on the body of the current page and display some pictures.) Is there a way to toggle the fullscreen mode or f11 key with javascript? Thanks in advance, ...

A bidirectional scale in Firefox extension

I am writing a firefox extension where I need a bidirectional scale element (https://developer.mozilla.org/en/XUL/scale) While the sample code of this xul element talks about a scale in one direction, how can I make a scale which can have a slider bar at the two directions so that I can take a range as the input? Thanks, Kapil ...

Setting focus to the address bar using a firefox extension

I'm developing an extension that requires to set focus to the address bar at some point. I've been trying to RTFM, but the FM is so hard to read! Does anyone know of any way to set focus to the address bar from within a firefox extension? TIA. ...

Any tool to allow moving of elements on a webpage to aid design?

Are there any tools/Firefox plugins that will allow you to drag elements (divs, images etc) about on the page, and tell you the amount (x, y) that you have moved it? It would speed up designing a page a lot, instead of tweak css, reload page, tweak css, reload page. I've found the Firefox Web Developer extension useful for editing the c...

What is the proper way to get bounding box for HTML elements relative to the Window?

I'm writing a Firefox extension. I'm trying to limit it to just XUL+Javascript (no XPCOM). When I get a mouseover event for an HTML element, I need to get its bounding box in the windows coordinate system (that is the built-in XUL document browser.xul). The obvious place to start is to put something like this in the mouseover event ...

jQuery doesn't work fully on a Firefox addon

I've included jQuery by doing this: <?xml version="1.0"?> <!DOCTYPE window SYSTEM "chrome://orkutmanager/locale/browser.dtd"> <overlay id="omcore" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt; <script type="application/x-javascript" src="../../jquery-1.4.2.js"/> <script type="text/javas...

Firefox Addon Storage Security

I was reading the Mozilla Doc about Firefox Addon Storage and it says: Storage is a SQLite database API. It is available to trusted callers, meaning extensions and Firefox components only. Well, it says its available to firefox only, but I managed to acess my Echofon storage by using a simple SQLite Manager for Linux. I found the .sql...

failed export of LD_LIBRARY_PATH with xerces and xml addon in firefox

I have installed: xerces-c_2_8_0-x86-linux-gcc_3_4.tar.gz on my SLED_11 (SuSE linux Enterprise) The site: https://addons.mozilla.org/en-US/firefox/addon/4522/ ask me to export this PATH: export LD_LIBRARY_PATH=/home/sigbj/xerces-c_2_8_0-x86-linux-gcc_3_4/lib/:$LD_LIBRARY_PATH Then to install the addon for xml above. The firefox retur...

Firefox extension data transfer to web page

I have a firefox extension that collaborates with a web page, and occasionally needs to inject data into it which the page formats and displays. The way I do it now is :- var element = doc.createElement("MyData"); doc.documentElement.appendChild(element); for(....) { var x = .... var y = .... var z = .... var row = do...

getDataURL for part of the canvas object

I am building a firefox plugin which allows users to draw any arbitrary figure on an object and save it as an image (png file). var $ = getJQueryOb(); var canvas = '<canvas id="canvas" width="1024" height="1024" style="position:absolute; top:0px; left:0px;"></canvas>'; var currentWindow = Components.classes["@mozilla.org/appshell/window...

if folder exists, return true

I can check if a folder is empty. this.emptyfolder = function(folderid) { result = PlacesUtils.getFolderContents(folderid); resultContainerNode = result.root; if (resultContainerNode.ChildCount == 0) { return true; } else { return false; } } How to check if a folder exists even if it's empty? link...

How to view "generated HTML code" in Firefox?

If using Firebug, we can click on the HTML tab, and click to expand each element to see the generated HTML code. Is there a way to expand it all or get a plain text file? I just accidentally found out that there doesn't even need to be Firebug. We can just press CTRL-A (to select all) on the webpage, and then right click and choose "V...

Creating a new Firefox add-on: XUL or Jetpack?

If you were going to start developing a new Firefox add-on today, would you still use XUL/JS or would you start using Jetpack, the new add-on framework? The XUL way of creating add-ons will continue to exist on Firefox 4 but Jetpack is clearly building steam and I imagine it will become the only way of creating add-ons in the future. ...

Firefox toolbar execution time and memory profiling

Hi All, So, I am working on creating a toolbar for firefox. It currently sucks as far as memory usage/execution time of the JS code I have written. I can say that since every so often firefox complains - "A script in mycode.js is taking more time than expected. Do you want to stop the script". I need to see which function is it thats do...

When using the firefox webdeveloper toolbar to edit CSS, why do some image disappear when the toolbar is open?

My typical workflow for editing and building my stylesheets for HTML documents is open the Firefox web developer toolbar's Edit CSS panel and edit directly in the browser window. Most of the time this works like a charm. There are times, however, that when I open the Edit CSS panel, certain images disappear, and I have no idea why. And ...