browser-addons

Download and save file inside my extension folder in Firefox?

不羁的心 提交于 2021-01-28 04:48:00
问题 I would like to do the following from my firefox addon: a). Determine my addons folder location. b). Prompt the user to initiate a download. c). Download and save the download All the code examples available are for older API's and I have no clue on how to get them working for recent E10 (multi-process) code changes. 回答1: A - Get addons folder location var OSPath_addons = Services.dirsvc.get('XREUSysExt', Ci.nsIFile).path B - Trigger download with path with no user notification How to

Accessing Cookies in Chrome Extension

柔情痞子 提交于 2020-01-04 06:43:28
问题 I'm trying to write a chrome extension that works with YouTube and need to access some of YouTube's cookie information. I cant seem to get my extension to see any cookies. (Even though I can see them under resources in the "Inspect Element" developer portion of Chrome). I'm pretty sure I've set up permissions correctly in the manifest 2 file because when I take out the "cookies" permission just to test it I get an error saying "Cannot call method 'getAll'". My current problem is just that no

XMLHttpRequest() does not work in the latest versions of Firefox?

徘徊边缘 提交于 2019-12-25 18:26:45
问题 In my addons I always used new XMLHttpRequest () and it worked perfectly. Now all requests ajax stopped working. Currently new XMLHttpRequest () is causing the following error: ReferenceError: XMLHttpRequest is not defined So I changed my code to: try { var XMLHttpRequest; if (typeof(XMLHttpRequest) == "undefined") XMLHttpRequest = content.XMLHttpRequest; } catch (e) { alert(e); } var xmlhttp = new XMLHttpRequest(); ... Sometimes the request usually works, but sometimes not. The code "alert(e

Firefox addon doesn't work when using % in menu label and tooltip

别来无恙 提交于 2019-12-24 08:47:07
问题 I am working on a firefox addon, and when I use % for a menu label and tooltip the addon doesn't work (doesn't show up on firefox). I am using the % in a .dtd file like this: <!ENTITY addonName.menuX "%09 (Tab)"> And in the .xul file like this: <menuitem class="menuitem-iconic" image="chrome://addonName/skin/image.png" tooltiptext="&addonName.menuX;" label="&addonName.menuX;" oncommand="addonName.function( 'X' )" /> If I delete the % from <!ENTITY addonName.menuX "%09 (Tab)"> it works fine. I

Self.port is undefined

只谈情不闲聊 提交于 2019-12-11 20:54:35
问题 I have an iframe in popup.html,having id = Receiver, which receives and posts messages. The below code is from popup.js: self.port.on("show", function(title, url) { myApp.initialize(title, url); }); var arr = new Array(); var myApp = { initialize: function (url,title){ arr = []; arr.push(url); arr.push(title); var receiver = document.getElementById('Receiver').contentWindow; receiver.postMessage(arr, "*"); }, sendDetails : function(){ alert("arr :"+arr); }, closeIt : function(){ self.port

Firefox addon to find Unused CSS styles [duplicate]

爱⌒轻易说出口 提交于 2019-12-07 11:23:55
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Tool to identify unused css definitions Lets say I have a page displayed in my browser and I have a .CSS file used on this page with rules like .class1{ /* some style definitions */ } .class2{ /* some style definitions */ } .class3{ /* some style definitions */ } .... ... .class1001{ /* some style definitions */ } Now my question is is there any addon which would tell me like out of these rules, which are "NOT

Firefox addon to find Unused CSS styles [duplicate]

做~自己de王妃 提交于 2019-12-05 13:02:33
This question already has answers here : Closed 8 years ago . Possible Duplicate: Tool to identify unused css definitions Lets say I have a page displayed in my browser and I have a .CSS file used on this page with rules like .class1{ /* some style definitions */ } .class2{ /* some style definitions */ } .class3{ /* some style definitions */ } .... ... .class1001{ /* some style definitions */ } Now my question is is there any addon which would tell me like out of these rules, which are "NOT USED" on the page.. I saw some related questions which provide links to addon that tell CSS selectors

What is The difference between Firefox extension and plugin?

柔情痞子 提交于 2019-12-04 08:56:15
问题 In Firefox there are plugins and extensions. Could you please explain to me why these addons have different name and tabs ? Does they differ so much so they need different names? I think it's a little unnatural to differ these things, extensions have so much and more functionality, what they lack for comparing to plugins? 回答1: The difference is both historical and real: plugins are compiled, loadable modules, originally descended from NPAPI; they can live outside of the browser's process

What is The difference between Firefox extension and plugin?

别说谁变了你拦得住时间么 提交于 2019-12-03 01:24:10
In Firefox there are plugins and extensions. Could you please explain to me why these addons have different name and tabs ? Does they differ so much so they need different names? I think it's a little unnatural to differ these things, extensions have so much and more functionality, what they lack for comparing to plugins? The difference is both historical and real: plugins are compiled, loadable modules, originally descended from NPAPI ; they can live outside of the browser's process space (which leads to all kinds of fun interoperability issues and vulerabilities). The most common examples of

Remember state chrome extension

冷暖自知 提交于 2019-12-02 07:07:33
问题 I use a chrome extension to fire two content scripts to inject css. If the user opens the page the contentscript-on.js loads (defined in my manifest.json): manifest.json { "name": "tools", "version": "1.1", "description": "tools", "browser_action": { "default_icon": "icon-on.png", "default_title": "tools" }, "manifest_version": 2, "content_scripts": [ { "matches": [ "*://*/*" ], "include_globs": [ "*://app.example.*/*" ], "js": ["jquery-1.11.0.min.js", "contentscript-on.js"] } ], "background"