FAQ Database Discussion Community


How emit function in firefox extension?

javascript,firefox-addon,firefox-addon-sdk
Can i emit function from one file to another in firefox extension? Example: main.js data = function() { return fn(); } panel.port.emit("resp", data); panel.js self.port.on('resp', function(fn) { return fn("some"); }); ...

setInterval not called in tab content-script

javascript,firefox,firefox-addon,firefox-addon-sdk
Simple use case: main.js var tabs = require('sdk/tabs'); tabs.open({ url: 'http://www.openstreetmap.org', onOpen: function (tab) { tab.attach({ contentScriptFile: './content.js' }); } }); content.js console.log("foo"); setInterval(function() { console.log("bar"); }, 1000); output foo I get the same problem with event handlers, which is more problematic…...

Can an extension similar to Simple Notes (Opera) be developed in Firefox?

firefox,firefox-addon
I have a very limited knowledge on the manipulation of overlays and XUL elements in Firefox extensions but I am interested to know if it's possible to do something like this "Simple Notes" Opera add-on in Firefox browser interface.

How to put BGRA array into canvas without re-ordering

javascript,canvas,firefox-addon
I have a BGRA array and need to draw it to a canvas. Currently i was doing it like this: var aVal = returnedFromChromeWorker; var can = doc.createElementNS(NS_HTML, 'canvas'); can.width = aVal.width; can.height = aVal.height; var ctx = can.getContext('2d'); ctx.putImageData(aVal, 0, 0); doc.documentElement.appendChild(can); Is there some way to get a...

Make javascript execute after javascript from add-on in firefox?

javascript,html,firefox-addon
I recently installed the add-on leechblock, which keeps track of how long you browse on specific sites and blocks you if you exceed the limits you set for yourself. Unfortunately the page it shows when blocking a site is pretty ugly, so I set out to make my own html-page...

firefox addon - how to open this kind of window?

firefox-addon,popupwindow
In firefox addon, I'm trying to create a popup like this for use in my addon - is it possible? If so, how's it done? Thanks in advance. ...

TcpSocket listen on Firefox addon

sockets,firefox,tcp,firefox-addon,tcplistener
I'm trying to create a Firefox addon that uses a TcpSocket for communication. I've successfully sent messages through tcp using the following code: var tcpSocket = Cc["@mozilla.org/tcp-socket;1"].createInstance(Ci.nsIDOMTCPSocket); var socket = tcpSocket.open("127.0.0.1", 3000); socket.onopen = function() { socket.send(sendText); } That works beautifully. Now, instead of sending, I want to receive tcp...

Using Mozmill for testing Firefox addon

javascript,python,firefox,firefox-addon,mozmill
I have a Mozilla Firefox addon and wanna test it. I've found Mozmill and wrote the small Python script, which is just taking each Firefox version and run the command like this: mozmill --binary=C:\browsers\firefox\38.0.1\firefox.exe --addon=C:\my_ext\ext --test=C:\my_ext\tests\mozmill\ Here is the script unit_test_runner_public.py: #!/usr/bin/env python # -*- coding: utf-8 -*- from subprocess...

What would be the best way to create a firefox plugin for taking desktop screenshots?

firefox-addon,screenshot
I need to create a firefox plugin that allows a user to take screenshots of any part of their desktop and have them uploaded to a server. There seems to be lots of plugins for screen capturing a webpage, but nothing for capturing anything outside of firefox. So after a...

Java backend for browser extension (Firefox add-on)

java,javascript,servlets,web-applications,firefox-addon
I intend to add visualization effects to existing web pages, powered by a MySQL database in the background. I assume this adding stuff to existing web pages requires writing a browser extension. For example, when Google returns search results, I want to customize the web page displaying (such as adding...

Components.classes ERROR - FireFox Add-On(Extension) in VS 2013

javascript,c#,visual-studio-2013,firefox-addon
I want to check javascript codes of a firefox add-on(extension) in visual studio 2013. I am c# web developer and so i created an empty web application project with c# language and created a new webform(Default.aspx) in that project and put those javascript codes in there. Here is the example...

Using the Web Crypto API from Firefox AddOn

javascript,firefox,firefox-addon,firefox-addon-sdk
I can't figure out how to access the Web Crypto API from an AddOn script itself (no documentation). Trying to do it from a content-script gives a permission error accessing then: JavaScript error: resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/loader/sandbox.js -> resource://..../data/content-script.js, line 36: Error: Permission denied to access property "then" The relevant code...

Firefox addon - how to use XMLHttpRequest in Chromeworker?

ajax,xmlhttprequest,firefox-addon
I am using ChromeWorker to download some data from a API. I am trying to import XHR in myWorker.js. importScripts("resource://gre/modules/workers/require.js"); var { XMLHttpRequest } = require("sdk/net/xhr"); I am getting the following error while running cfx run Error: TypeError: The argument to require() must be a string uri, got sdk/net/xhr I...

on(“show”, function()) doesn't work in FF extension

javascript,firefox-addon
I have FF extension where on showing panel event focus automatically should be on text input field parameter. I am using on("show", function()) (in scrip.js) for that, but no matter what I insert into this function it doesn't work. Any suggestions? main.js: var panel = panels.Panel({ contentURL: self.data.url("index.html"), contentScriptFile: self.data.url("script.js"),...

access custom dom function from firefox add-on

firefox-addon,firefox-addon-sdk
I am working on a Firefox Add, using the newest SDK. The problem I am having, is that when ever I try to run a custom dom function it doesn't work. Scenario: The firefox add-on must be able to loop through all tabs, and if the correct one is open...

Firefox addon - Catch post variables before submit [no enctype]

javascript,firefox,firefox-addon,firefox-addon-sdk,tamper-data
I have the following form: <form method="post" action="includes/do.php"> <input type="text" name="action" value="login" /> <input type="text" name="email" value="[email protected]" /> <input type="text" name="pass" value="helloworld" /> <input type="submit" value="Send" /> </form> Then, I want to catch the variables values before being submitted inside a firefox addon observer. Notice that the form DOESN'T have...

evalInSandbox fails to find function in Firefox 38

javascript,firefox-addon
I use Components.utils.evalInSandbox to execute js function in my firefox extension. But this api fails after I upgrade firefox to version 38. it always throws error "*** js function not defined", which seems that there is no such js function on web page. However, the reality is the js function...

Firefox Add-Ons: Variable Is Not Defined In Console

javascript,debugging,firefox,firefox-addon,xul
I'm developing a Firefox extension. When I run it, I open up the browser console and it says, [name] is not defined. It's in "browser.xul." <?xml version="1.0"?> <?xml-stylesheet href="chrome://Uedit/skin/skin.css" type="text/css"?> <!DOCTYPE Uedit SYSTEM "chrome://Uedit/locale/translations.dtd"> <overlay id="Uedit-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script src="Uedit.js" /> <toolbarpalette id="BrowserToolbarPalette"> <toolbarbutton id="Uedit"...

Copy to clipboard from Firefox add-on content script

javascript,firefox,copy,firefox-addon,firefox-addon-sdk
I want to write a content script in a Firefox add-on that will copy a string to the user's clipboard in response to an event. I know that I can do this with the Firefox clipboard API like this: var clipboard = require("sdk/clipboard"); var val = "Lorem ipsum dolor sit...

How to check whether the html has changed?

javascript,html,web-scraping,firefox-addon,web-crawler
Apologies if that's the wrong place, but have no clue where to ask. We are building Firefox addon that works on selected websites. Now, because those websites tend to change once in a while, I want to run once a day a javascript script that will check whether the specific...

best option for firefox extension to keep panel / overlay / sidebar visible between pages?

firefox-addon,firefox-addon-sdk
The Firefox SDK Panel disappears whenever the user interacts with the page. Does anyone have a suggestion of the best approach that will continue to work that would allow something like a panel, overlay or sidebar to remain active as the user changes pages? From what I've read, it looks...

js-ctypes and c# unmanaged dll in windows xp

c#,firefox-addon,unmanaged,jsctypes
I have a unmanaged c# dll (using Giesecke Dllexport). When I open this dll with js-ctypes in Windows 7,8 64/32 bits it works, but if I try it on Windows XP i get the error: "couldn't open library". I made this dll using .Net Framework 2.0. using RGiesecke.DllExport; using System;...

Postman addon's like in firefox

firefox,firefox-addon,postman
Is there a recommended add-ons in the firefox, which is has the most features that postman have?

how to append iframe to hosted page using Firefox SDK addon?

firefox,firefox-addon,firefox-addon-sdk
Assume frame.html inside data folder in Firefox SDK addon, how to append an iframe and define frame.html as its source? Additional info: Because of CPS, its not possible to use inline source, so I can't use data.load('frame.html'), I need to use URL of the file: lib/main.js tabs.activeTab.attach({ contentScriptFile: [self.data.url("js/appender.js") ],...

Should I specify the application when using the same XUL overlay?

firefox-addon,xul,mozilla,thunderbird,seamonkey
Let's say I want to use a single overlay in three applications at the same time. Should I specify which line in the manifest file applies to which application? Here's an example of what I currently have: overlay chrome://browser/content/browser.xul chrome://myaddon/content/commonOverlay.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384} overlay chrome://messenger/content/mailWindowOverlay.xul chrome://myaddon/content/commonOverlay.xul application={3550f703-e582-4d05-9a08-453d09bdfdc6} overlay chrome://navigator/content/navigator.xul...

Firefox extension : gMultiprocessBrowser is not defined

javascript,firefox,firefox-addon
I am porting a Firefox v22 extention Firefox v31, my plugin works fine on FFv22 but its not working on FFv31. In my plugin I have changed the overall browser look, so I have made changes in browser.xul. The problem which i am facing is that I cannot open any...

Get localized name other channel

firefox-addon
I get the version number of the firefox from the applications.ini. Then I hardcoded that between date #### and #### v35 is release. So now based on this and the current date and version from applications.ini I figure out the channel of other builds. But now I want to get...

Request object response always empty

firefox-addon,firefox-addon-sdk
Here's my main.js require('sdk/request').Request({ url:'https://google.com' ,onComplete:function(response){ console.log('response',response) } }).get() which gives me console.log: extension: response constructor {} At first I thought it was a permissions thing, but I whitelisted google and still no response "permissions": { "private-browsing": true ,"cross-domain-content":["https://google.com"] } I'm using FF31...

How to test google analytics in firefox browser?

firefox-addon,event-tracking
As a part of Google analytics testing, i am testing the events fired, page view hits, conversions, label etc.. in firefox browser. I couldn't find great add-on's as i found in Google Chrome browser to test the attributes mentioned above . Can you let me know if there is any...

Incorrect scope for eval

firefox-addon
I have this code eval(script); where script is: var script = console.log('xwin:', xwin); however it keeps telling me that xwin is undefined, anyone know why eval is not taking the functions scope? Anyone know how to make it?...

Firefox addon uploading canvas contents to imgur

javascript,firefox-addon,firefox-addon-sdk,imgur
I am writing an addon in firefox that automatically sends the contents of a canvas to imgur. I have already built a similar extension in chrome, where it works as expected, so I know that the usage of imgurs API is correct. When I use the same approach in the...

Right click does not work in panel (firefox addon-sdk)

firefox,firefox-addon,firefox-addon-sdk
i am creating a firefox addon using SDK and i was wondering why right click is not working inside the panel. Is there anyway to make it work ? or Is it meant to be in this form ?

Badged Buttons from Non-SDK

firefox-addon,firefox-addon-sdk
Does anyone have any tricks on how to use the badged buttons feature of addon-sdk from non-sdk addons? https://developer.mozilla.org/en-US/Add-ons/SDK/Low-Level_APIs/ui_button_action#Badged_buttons If no tricks my thinking was to use maybe override xbl and/or override display='xul:button' from techniques listed here: To anonymous element add pseudo element and cursor style and event listeners...

How to use a contentScriptFile from an external URI in a Firefox addon

javascript,jquery,jquery-ui,firefox,firefox-addon
My latest update to a Firefox addon has been rejected because I've used a custom jquery-ui (generated by their site with just the widgets I wanted) and it fails their checksum check. Your add-on includes a JavaScript library file that doesn't match our checksums for known release versions. We require...

How can i get the firefox add-on version number?

firefox-addon
My extension has package.json file containing install attribute. Is there any way to get the add-on version.

HTML transient modal window

javascript,firefox,modal-dialog,firefox-addon,privileges
We have a legacy web application. At various places it opens a window with the help of Privilege Manager on Firefox to get the needed result. Some of these windows open a Java applet or a PDF document. The client machines are updating Firefox and Privilege Manager is gone. What...

firefox extension works through sdk but not when installed in browser - compatibility issue?

javascript,firefox,firefox-addon,firefox-addon-sdk,mozilla
---Update---- After experimenting more with this, I've determined that the contentScript I have written is not the problem here. For example, if I reduce the extension to merely: var buttons = require('sdk/ui/button/action'); var data = require("sdk/self").data; var self = require("sdk/self"); var button = buttons.ActionButton({ id: "library-link", label: "External Resource Locator",...

Can't get xpi to work in TorBrowser

firefox,firefox-addon,tor-browser-bundle
I created a small little HelloWorld extension and was able to get it to work in Firefox 31 (which TorBrowser is based on). However I'm unable to get it to work in TorBrowser. Any idea why that might be and how I can fix? This is my main.js var contextMenu...

firefox extension: intercepting url it is requesting and blocking conditionally

javascript,firefox,firefox-addon,firefox-addon-sdk
in firefox extension I want to intercept the url browser is making request to and block the request entirely if some condition matches how can I intercept URL being requested...

Disbale the “Not available for your platform” on the addons.mozilla.org

firefox-addon
Does anybody know how to disable this message and also to disable gray "Download" buttons? I wanted to download some addons for Android platform from my desktop PC. When I load an addon page in Firefox it doesn't allow me to "Save Link As..." and the button is gray. I...

javascript firefox sdk: get domain without subdomain

firefox,firefox-addon,firefox-addon-sdk
what is an easy way to get the domain without the subdomain. For example in this URL: http://a.b.hllo.co.uk I want to retrieve hllo...

xul overlay for new menu in TB/Firefox main menubar

firefox,firefox-addon,overlay,xul
I'd like to add a new menu at the end of the main menu bar (file, edit, ...) after the Help menu via an extension i wrote. I already know how to add a new item to one of the menus by something like: <menupopup id="menu_HelpPopup"> <menuitem id="example-item" oncommand="alert('Hello!');" label="TEST"...

JavaScript: XMLHttpRequest() from Firefox addon to get zip

javascript,firefox,xmlhttprequest,firefox-addon,zip
I am trying to build a Firefox addon to request a zip file from a webpage and store it locally/decompress. I receive a 200 response code when I request the zip as a Blob type, but I am unsure how to store it since the Firefox file I/O documentation is...

Firefox addon SDK - attaching a stylesheet to a tab triggering an error

firefox,firefox-addon,firefox-addon-sdk
I'm trying to add a content script to a tab when the tab loads, but my code is throwing TypeError: window.QueryInterface is not a function' when I run the attachTo method. var attachTo = require('sdk/content/mod').attachTo; var style = require('sdk/stylesheet/style'); tabs.on('ready', function(tab) { var worker = tab.attach({ contentScriptFile: ['./content.js'] }); var...

Can I somehow listen on the URL user is typing with Firefox addon SDK?

firefox-addon,firefox-addon-sdk
Is there a way with Firefox Add-on SDK to get the URL while user is typing it in the location field?

A way to activate a script on a tab in FireFox when a specific URL is opened

firefox,firefox-addon,code-injection,firefox-addon-sdk
As the title says, I need my addon to execute a script that will inject some CSS when a specific URL is opened. How would one go about calling on a script to run?

Addon to modify http headers specified via regex of content

regex,firefox,http-headers,firefox-addon
I need a Firefox addon that would enable me to modify outbound http request headers thusly: "[pseudocode] if any request header contains x in its content then replace x with y" where x is a regular expression and y preferably can contain substitution patterns referencing x. I've looked at the...

It is possible to create a hyperlink to the JS debugger in firefox?

javascript,firefox,firefox-addon,firefox-addon-sdk
The webconsole from FF outputs a hyperlink to the js debugger/source when an error/warning occurs. Is it possible to create such a link in my own devtools extension. And when yes, how? ...

Unable to override XMLHttpRequest using pageMod (Firefox addon)

javascript,firefox,xmlhttprequest,firefox-addon
I have some troubles trying to override the XMLHttpRequest from a Firefox addon context. The reason why I want to override this function is that I want to know when a certain request is made in order to fire one of my event. The main.js I am currently using: pageMod.PageMod({...

Compilation of firefox extension with xulrunner-sdk-36.0 C++

firefox-addon,firefox-addon-sdk,xpcom
I have a FF toolbar working in all previous versions. My toolbar partially written in C++. I've tried to build the C++ part with a new xulrunner-sdk-36.0 I've receive such link errors: 1>xpcomglue_s.lib(nsISupportsImpl.obj) : error LNK2038: mismatch detected for '_MSC_VER': value '1800' doesn't match value '1600' in Encryption.obj 1>xpcomglue_s.lib(nsStringAPI.obj) :...

Receive message from main.js in Firefox add-on content script

javascript,firefox,firefox-addon,firefox-addon-sdk
I'm trying to communicate between main.js and a content script. Here is my main.js: var pageMod = require('sdk/page-mod'); var self = require('sdk/self'); var ss = require('sdk/simple-storage'); pageMod.PageMod({ include: 'example.com', contentScriptFile: self.data.url('content-script.js'), onAttach: function(worker) { worker.port.on('getSetting', function(request) { // var settingValue = ss.storage[request] var settingValue = 'test value'; // for testing,...

How to create UI with Mozilla Addon SDK?

javascript,firefox-addon,firefox-addon-sdk,xul,mozilla
I want to crate an extension for Mozilla Firefox which process HTML code and generates screen reader output in a new window. I need to create a UI window (without tabs, panels and addressbar) and i´ve only found a tab and window method in SDK API which opens a new...

browser plug-in or extension, which to choose?

javascript,google-chrome-extension,firefox-addon,browser-plugin,browser-extension
I intend to modify the display of existing websites. For example, when Google returns search results, can I customize the web page displaying (such as adding some bubble visualizations onto that page's blank places) ? Could it be done using browser plug-in or extension? Based on my knowledge, a browser...

Within ChromeWorker deteciting OS Details

operating-system,firefox-addon
I'm trying to detect the OS details like OSX 10.6.x or 10.8.x or 10.10.1 (Or win7 winXp etc) in ChromeWorker. I know i can send it from the other side but i was looking for an internal way. This is the way i do it on the other side: Get...

Converting HashString from C to JS

javascript,c++,c,firefox-addon
I'm trying to convert this function from the Mozilla Firefox code base, it's called HashString. It calls a bunch of functions which are all in this file: https://dxr.mozilla.org/mozilla-central/source/mfbt/HashFunctions.h#294 So these are the C functions it calls: static const uint32_t kGoldenRatioU32 = 0x9E3779B9U; MOZ_WARN_UNUSED_RESULT inline uint32_t HashString(const wchar_t* aStr) { return...

Overriding `onClick` on a Firefox-Addon ActionButton

javascript,firefox-addon,firefox-addon-sdk
When creating a plain old ActionButton in a Firefox Add-on, it seems that one cannot override the onClick property after creation. Anyhow, this var handleClick = function() { tabs.open('https://www.mozilla.org/'); }; var button = new ActionButton({ id: 'my-link', label: 'label me', icon: { '16': './icon-16.png', '32': './icon-32.png', '64': './icon-64.png' }, onClick:...

firefox bootstrap addon: install event is not executed

javascript,firefox,firefox-addon,firefox-addon-sdk
I'm trying to create a bootstrapped addon that just sets the new tab url at install to a new value and resets it to the old one when it gets uninstalled. Here is my bootstrap.js. I think the install function throws an exception because require is not defined, but I'm...

How to open firefox “open menu” using keyboard shortcut?

java,firefox,selenium,selenium-webdriver,firefox-addon
How to open firefox "open menu" using keyboard shortcut? I am unable to find the keyboard shortcut on google. I want to automate the process using selenium as I want to open an installed add on. ...

Message Passing From firefox extension to mac app

objective-c,osx,firefox-addon,jsctypes
I have a mac app which receives broadcast distributed notification messages with code NSDistributedNotificationCenter.defaultCenter().addObserver(sender, selector: "testaction:", name: "myNoti", object: nil) i also have developed firefox extension using Addon SDK I knows their is javascript - Objc bridge in which we can import system Frameworks and write objective c code in...

Manual adding firefox for android addon

android,firefox,firefox-addon
I've got an firefox add-on, but I want to test before I upload it to the firefox add-on center.. Does anybody know if I can install the add-on (XPI file) on firefox for android? Thanks for help....

How to use modules in Firefox addon development

javascript,firefox-addon
Trying to create a firefox addon that accesses the browser cookies. Following googled tutorials I've written the following function but looks like the Services.jsm is not accessible? Components.utils.import("resource://gre/modules/Services.jsm"); var myExtension = { myListener: function(evt) { //I get here alert("Received from web page: " + evt.target.getAttribute("attribute1") + "/" + evt.target.getAttribute("attribute2")); //I...

XUL iframe firefox addon, how to change the src within the iframe?

javascript,firefox,iframe,firefox-addon,xul
I am developing a firefox addon, in my settings page dialog.xul i have an iframe where i load different settings pages page1.xul page2.xul page3.xul Iframe : <vbox flex="1"> <iframe id="iframe" src="chrome://xxx/content/page1.xul" flex="1"></iframe> </vbox> Within the iframe i need to navigate from page2.xul to page3.xul with the code in page2.xul My...

Is there an API to control downloads in Firefox add-on SDK?

firefox,firefox-addon,firefox-addon-sdk
In Firefox, is there an API equivalent to Google Chrome's chrome.downloads API? I need to control downloads with functions such as pause, resume, and cancel. In addition, I want to be able to remove the downloaded file. If there is no API in Firefox add-on SDK, is it possible to...

How to get notified whenever the URL in the address bar changes Firefox JPM

javascript,firefox-addon,firefox-addon-sdk
Is it possible to detect whether an URL changes, while developing Firefox addons using the new SDK/JPM? It's not exactly hashchange what I want to detect, but any changes to the URL, like ajax request changing search terms or things like that. Is it a way to do it? Thanks....

FireFox Extenstion - Using Components - Hex Decoding

javascript,firefox-addon
I am working on a FireFox Extension and want to know what are these codes and what do they do : const {classes: Cc, interfaces: Ci, utils: Cu} = Components; Cu.import("resource://gre/modules/Services.jsm"); var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]. getService(Ci.nsIWindowMediator); var windows = wm.getEnumerator("navigator:browser"); global_win = windows.getNext().QueryInterface(Ci.nsIDOMWindow); var my_integer = check_me_1() + check_me_2(); alert(my_integer);...

Firefox addon: TypeError: getBrowserForTab(…) is undefined

firefox,firefox-addon,firefox-addon-sdk
While attaching an object to window of the active tab in main.js, I get following error: Message: TypeError: getBrowserForTab(...) is undefined Here is the code that I've used to attach the object: var { getTabs, getTabContentWindow } = require('sdk/tabs/utils'); tabs.on('load', function(tab) { var window = getTabContentWindow(tab); window.myObject = { data:...

Firefox - Intercept/Modify post data when some variable match some pattern

javascript,firefox,firefox-addon,http-post,tamper-data
I would like to know if it is possible to intercept and modify a post data when the url and some of the variables meet some pattern. for example: let the login url be: http://www.someonlineprofiles.com let the post data be: email: "[email protected]" pass: "mypass" theme: "skyblue" I would like that...

How to make for loop with ajax not freeze my Firefox Extension?

jquery,ajax,for-loop,asynchronous,firefox-addon
I make firefox extension which does ajax calls every one minute. what the script does, is looks through LI elements on given page and returns it page/position if match is found Here is part of my problematic code: var item_name = 'test'; var items_per_row = 8; var last_index; var last_status;...

Load image using crossOrigin attr. in Firefox addon sdk

javascript,firefox,firefox-addon,cross-domain,firefox-addon-sdk
In content script in Firefox addon SDK I'm loading image like this way: var img = new Image(); img.crossOrigin = "Anonymous"; img.src = URL; img.onload = function (data) { var canvas = document.createElement("canvas"); canvas.width =this.width; canvas.height =this.height; var ctx = canvas.getContext("2d"); ctx.drawImage(this, 0, 0); var dataURL = canvas.toDataURL("image/jpeg"); callback.call(this,dataURL); }...

File types change into .xml while downloading in Firefox

c#,asp.net,firefox,firefox-addon,firefox-addon-sdk
In my asp .net application we can upload doc files and after uploading files we can view it in browser. It is working in all browser, but there is one issue while view through Firefox, while clicking hyperlink view the file is being download, but file type changes into .xml...

Can I put a button on the tab header using Firefox Add-on?

javascript,firefox,firefox-addon
In a Firefox browser window, I would like to put a button on the tab header next to the web page title. Is this possible with a Firefox add-on? So far I am still unsure what to call this part of a tab. Sorry for duplicates! Edit: I didn't have...

Closing tabs with a specific meta TAG in firefox-addon using javascript

javascript,firefox-addon,firefox-addon-sdk
I have this addon which inserts the following "meta" TAG on the pages it opens.Towards the end, I want to close all the tabs with that TAG on the page header. <meta id="CLOSE_LATER"> I have written a simple for-loop: var TAG = "CLOSE_LATER"; var tabs = require("sdk/tabs"); for(var i=0; i<tabs.length;...

channelUrl error in Firefox addon while trying SE OAuth init

javascript,oauth-2.0,firefox-addon
I am trying to develop a Firefox addon that uses StackExchange API, using the client-side OAuth flow. I am just using the sample code found in StackApps documentation: SE.init({ clientId: 4267, key: '8p1pDgmKlR6m6hUn80n21Q((', channelUrl: 'https://api.stackexchange.com/docs/proxy', complete: function(data) { $('#login-button') .removeAttr('disabled') .text('Run Example With Version '+data.version); } }); ... When trying...

Firefox extension app hosted on server

firefox,firefox-addon,firefox-addon-sdk
I managed to create a Chrome extension pretty easy and the main application is hosted on my server allowing me to provide updates to the app itself without having to update the whole extension. I like the idea and I just want to know if it's possible to create a...

gInitialPages is not defined bootstrapped extensions

javascript,firefox-addon,firefox-addon-restartless
I am working on Firefox extension that overwrite new tab page and I need to hide my page URL from address bar. I use this code: if (gInitialPages.indexOf(NEW_TAB_URL)===-1) gInitialPages.push(NEW_TAB_URL); It works correctly in XUL Overlay code, but I'm getting an error when I try to make my application restartless and...

Detect tab url change inside firefox add-on

firefox,firefox-addon,firefox-addon-sdk
I have an extension that works on chrome that monitors the active Tab for url changes. Specifically i needed to detect when the url changed but there was no new page load or navigation, (some sites do this, like youtube when you click to view another video) On chrome i...

Firefox extension not working with URLs other than http:// https://

javascript,firefox,firefox-addon,xpi
I have installed two Firefox Extensions to translate words when I double click on them: Google Translator and Wictionary and Google Translate. Both offer you the possibility to translate words just by double clicking on them. But the difference is, Wictionary and Google Translate just works everywhere i double click....

Mozilla Javascript Performance NEW OS.File vs OLD nsIFile over 3000 files

javascript,firefox-addon,mozilla,xulrunner
i have a directory that contains small XML files (every file is 170~200 bytes), and i want to read all content of every file and merge them in a single XML file, displayed in a tree. OLD FileUtils.File + NetUtil.asyncFetch + NetUtil.readInputStreamToString Time to read 3000 XML files 1112.3642930000005 msec...

How can open Firefox developer tools in my extension's sidebar?

firefox-addon,firefox-addon-sdk
I have developed a Firefox extension which includes a sidebar using the SDK. However, if I right-click inside the sidebar and choose "Inspect Element", I get this error in my terminal: JavaScript error: chrome://browser/content/nsContextMenu.js, line 570: TypeError: gBrowser is null Needless to say, nothing happens and the developer tools do...

nsICacheService doesn't work in Firefox 38

javascript,firefox,firefox-addon
I use Components.classes["@mozilla.org/network/cache-service;1"].getService(Components.interfaces.nsICacheService); to manipulate http cache when developing Firefox extension. But after I upgrade to Firefox 38 esr, this interface throws error when calling its function [Exception... "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsICacheService.visitEntries]" nsresult: "0x80004001 (NS_ERROR_NOT_IMPLEMENTED)" And I didn't find it obsolete in MDN, so anyone knows why?...

How to call native C code, using the js-ctypes Firefox extension?

javascript,c,firefox-addon,jsctypes
I am trying to build a Firefox extension, that needs to call native C code. My C program code is: #include<windows.h> int add(int a, int b) { return(a + b); } and my JavaScript code is : var {Cu} = require('chrome'); var self = require('sdk/self'); Cu.import("resource://gre/modules/ctypes.jsm"); var lib; var puts;...

Firefox addon - cannot trigger click event of any kind

javascript,jquery,firefox-addon
I am working on a firefox addon that will automatically populate the login form fields and login. What I have access to could be anything from id's classes' or the xpath to the login button depending on what the website gives. The priority captured will usually be id's if they...