firefox-addon,xul,mozilla,thunderbird,seamonkey , Should I specify the application when using the same XUL overlay?
Should I specify the application when using the same XUL overlay?
Question:
Tag: 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 chrome://myaddon/content/commonOverlay.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
Is it safe to omit the application flags, or is the best practice to be as explicit as in my example?
Answer:
This depends on what your add-on is actually supporting via em:targetApplication
.
Usually having an application=
is not required, because there simply is no ambiguity.
The only case I can imagine where it actually would make sense, would be if your add-on supported two different applications, which both have e.g. a chrome://browser/content/browser.xul
but you only want to overlay Firefox but not the other application. There you'd need to be explicit.
Related:
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...
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...
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. ...
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...
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...
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...
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);...
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…...
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...
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-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,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.
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...
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"...
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...
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...
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...
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...
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:...
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...
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",...
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...
javascript,sqlite,xul
I have XUL desktop app which stores data in SQLite database. To prevent too much data store in DB i want to create some kind of auto dumping system for my DB. My idea is to store timestamp of last DB dump so on every app boot to check for...
xul,onload
Is there a simple script which will allow me to be notified if the a page is loaded in the current tab or if a new tab is now in focus?
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...
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. ...
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...
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...
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...
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...
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...
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:...
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"...
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...
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...
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...
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;...
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?...
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...
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...
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....
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...
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...
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,...
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,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") ],...
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...