Category : firefox-webextensions

I’m trying to list the downloads in the console using the following functions: function listFiles(downloadedItems) { console.log(downloadedItems); } function getFiles() { var searching = browser.downloads.search({ limit: 25, orderBy: ["-startTime"] }); searching.then(listFiles); } When running the extension I get undefined for the output of the above. My Manifest file is requesting downloads access: "permissions": [ "webNavigation", ..

Read more

I’m creating a Firefox extension and am having trouble loading my scripts into the templates: My template: <html> <head> <meta http-equiv="Content-Security-Policy" content="script-src ‘unsafe-inline’"> <meta content="text/html;charset=utf-8" http-equiv="Content-Type"/> <meta content="utf-8" http-equiv="encoding"/> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <link href="../stylesheets/hub.css" rel="stylesheet" type="text/css"/> <script src="../scripts/hub.js"></script> … <div id="continue-button"> <button type="button" onclick="saveKey(document.getElementById(‘api-key-input’).value);">CONTINUE</button> </div> … </div> </body> </html> When I load the template ..

Read more

New to web extension development & I’m trying this example. However when I run this extension it does not trigger the listener. This is the manifest file. { "description": "Altering HTTP responses", "manifest_version": 2, "name": "http-response-filter", "version": "1.0", "homepage_url": "https://github.com/mdn/webextensions-examples/tree/master/http-response", "permissions": [ "webRequest", "webRequestBlocking", "http://localhost:8000/*" ], "background": { "scripts": ["browser-polyfill.min.js", "background.js"] }, "browser_specific_settings": { "gecko": ..

Read more

I have created a custom WebComponent named search-window that extends HTMLElement for my Firefox addon. What I’ve noticed is that when I console.log( document.getElementByTagName(‘search-window’) ) I don’t see the properties inherited from the Parent and the prototype shows as restricted(check screenshot below). Inside my class definition I can access all the properties using eg. this.offsetLeft ..

Read more

Following the online guide: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/cookies/getAll I am not able to do a fetch of the cookies when running in "temporary" mode. The manifest is pretty simple: { "manifest_version": 2, "name": "domain", "version": "0.0.1", "description": "Add to domain on the web", "permissions": [ "cookies", "https://www.example.com/" ], "browser_action": { "browser_style": true, "default_icon": "images/logo.png", "default_popup": "index.html", "default_title": "domain" ..

Read more

I am trying to load a website inside an iFrame but the server is sending the X-Frame-Options: SAMEORIGIN header so I’ve tried to use onHeadersReceived to modify the headers though I cannot get it to work. manifest.json { "manifest_version": 2, "name": "__MSG_extensionName__", "description": "__MSG_extensionDescription__", "default_locale": "en", "version": "0.1", "author": "author", "homepage_url": "https://github.com/", "icons": { "48": ..

Read more

I am trying to create an add-on for Firefox, I am going step by step so I used a simple snippet from MDN to get me going. This is the manifest.json { "manifest_version": 2, "name": "__MSG_extensionName__", "description": "__MSG_extensionDescription__", "default_locale": "en", "version": "0.1", "author": "author", "homepage_url": "https://github.com/", "icons": { "48": "assets/icons/icon.png" }, "background": { "scripts": ["scripts/dist/background.js"] ..

Read more