All Questions
Tagged with firefox-addon-webextensions firefox-addon
591 questions
1
vote
1
answer
20
views
"Uncaught TypeError: browser.browserAction is undefined"
Trying to create a webextension, following the example from firefox bookmark-it!. I'm developing on 132.0.2 (64-bit).
I think I have copied it almost word by word, but i get on my background.js script:...
0
votes
0
answers
19
views
Firefox extension access to all localStorage similar to all cookies
It's possible to get all cookies (e.g., in the extension background) that the browser has stored using code like
browser.cookies.getAll( {
firstPartyDomain: null,
partitionKey: {},
storeId: ...
0
votes
1
answer
68
views
Firefox Extention onMessage sendResponse
I'm having a pretty frustrating problem with these firefox extensions. Specifically, the problem is that I cannot obtain and then use the data following the sendResponse of onMessage.addListener. Here ...
1
vote
2
answers
63
views
First Firefox extension test not going well
I am writing a first test of a firefox extension. I am using the following websites as assistance:
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Your_first_WebExtension
https:/...
0
votes
1
answer
58
views
Show custom HTML in Firefox add-on popup/dialog
I'm learning how to make an extension (for Firefox).
This add-on reads the youtube main page (https://www.youtube.com/) and get the visible videos on it. From those videos, I'm able to extract the ...
1
vote
1
answer
74
views
JavaScript: openpgp is not defined error in Firefox extension content script
Original Question:
Problem Description
I am developing a browser extension that uses OpenPGP.js to encrypt and decrypt selected text on a webpage. The extension works perfectly in Chrome, but I ...
0
votes
1
answer
87
views
EventTarget doesn't work in Firefox content script, does work in Chrome
In Chrome extension content scripts it is fine to do:
const myTarget = new EventTarget()
myTarget.addEventListener('test', () => console.log('test1'))
myTarget.dispatchEvent(new Event('test'))
but ...
3
votes
1
answer
47
views
Why cookies can not be returned?
I have the following firefox extension. I want to get cookies from the browser. But when I click "All" in the extension, the console.log(await (browser.cookies.getAll({})) only print an ...
1
vote
0
answers
72
views
Adjusting Mozilla extension: page action task for a target page
I'm trying to adjust simple Firefox extension: page_action for a particular page: when the user clicks the page action icon on that page, it should navigate to https://target-web-page.asp (i.e. action ...
1
vote
0
answers
105
views
How to use runtime.sendMessage from background to a content script?
I'm trying to use browser.runtime.sendMessage from background.js to a content script, but I keep having the error:
Uncaught (in promise) Error: Could not establish connection. Receiving end does not ...
1
vote
0
answers
29
views
Cannot load two temporary extensions at the same time in Firefox?
I load a temporary extension(with a content script) in Firefox by "about:debugging#/runtime/this-firefox" and this extension works fine. Then I load another temporary extension(with a ...
2
votes
0
answers
346
views
Extension on Firefox running with only on clicked
I have a dark mode extension that injects a CSS file into a website. It works fine for all other browsers (Edge, Chrome, Opera, etc) except for Firefox where the user has to manually select the ...
1
vote
0
answers
43
views
WebRequest Header Modification on other extensions
I am currently trying to write a compatibility extension for raindrop.io. Some hosts I am working with a lot require some additional fields added to the header, otherwise they reject the request. ...
1
vote
1
answer
171
views
Why can I not load a simple custom firefox extension/addon xpi file? Tried everything
I'm trying to load a simple xpi file I created from this walkthrough below using Android Firefox Nightly.
Things I've done so far
Tried different compression methods to make the zip/xpi
Set xpinstall....
1
vote
0
answers
62
views
Firefox extension background script terminated preemptively
I have a Firefox extension that for certain pages listens to the webRequest.onHeadersReceived for specific URLs that it opens in order to remove the "content-disposition" header when it ...
1
vote
2
answers
65
views
I'm building addon for firefox user can take screenshot, but browser.runtime.sendMessage returns undefined
I'm trying to implement a function that user can take screenshot using browser.tabs.captureVisibleTab .
But browser.runtime.sendMessage immediately returns undefined.
In console.log("dataUrl ::: &...
2
votes
1
answer
157
views
How do I fix the following issues with my port of a manifest v2 browser extension to manifest v3?
I am in the process of transitioning a manifest v2 Chrome extension to manifest v3 and while converting my background script background.js to a service worker, and I am getting error messages in ...
1
vote
1
answer
722
views
How to open a deeplink without creating a new tab or window in a web extension
I have an anchor tag which when selected should open a link to an external application (Obsidian). Here's an example link: obsidian://action?param1=value¶m2=value.
I expect that clicking on ...
1
vote
0
answers
19
views
firefox extension, read background script variable from popup? [duplicate]
I have a firefox extension:
background_script.js:
const textVar = "some text"
browser.menus.create({
id: "selection-to-tg",
title: "send selection",
type: "...
1
vote
0
answers
154
views
webRequest API not working with manifest v3 extension
I'm trying to migrate an extension which uses the webRequest API from manifest v2 to v3 for both Firefox and Chrome. While it works as expected in Chrome, I can't get the webRequest API to work in ...
1
vote
0
answers
146
views
browser.webRequest.onBeforeRequest is not being triggered in my firefox extension
I am trying to intercept http request made using fetch / XmlHttpRequest in my firefox extension following the example here, but nothing is logged in debugger console.
//manifest.json
{
"...
1
vote
0
answers
55
views
Python programme executes all lines but does not run any 'subprocess.Popen()' lines
I have simple Firefox add-on that, I am using it to test and discover the capabilities of Native Messaging, something I recently came across.
The add-on side of things works as I expect it, nothing ...
1
vote
1
answer
182
views
Messaging content script works when using 'webRequest.onBeforeRequest()' as the trigger but not when using 'webRequest.onCompleted()'
I finished writting my first extension and it works as I programmed it, but after completing it, I realised I made a mistake in its design, currently its designed to alert me before a event occurs (...
2
votes
0
answers
82
views
DataCloneError on Loading Native App on Firefox MacOS
I am trying to build a Firefox extension using Native Messaging on MacOS.
I was referring to this example.
When I have only one line in my background.js:
let port = browser.runtime.connectNative("...
1
vote
0
answers
141
views
Running Worker in background.js in Firefox Extension
What is the correct way of running Workers in Firefox background.js? Content-Security-Policy(CSP) seems to be blocking the script. (I am using MV2 because I want to run Web Assembly.)
I tried using ...
1
vote
1
answer
150
views
Firefox extension to obtain IP address through the current tab
I'm developing a Firefox web extension that obtains the IP address of the host through the current tab. In details, I have a Firefox extension that is able to assign a specific proxy to a specific ...
1
vote
0
answers
49
views
Chrome and/or Firefox extension to show image outside of site embedding
You know how sometimes on sites like Pinterest, Reddit or Tumblr, when you try to open an image in a new tab, it clumsily displays the image in the website? I was wondering if there was an extension ...
1
vote
0
answers
45
views
I made a firefox extension, but I have to click the extension icon on the toolbar to make it run. How do I run it automatically when entering da site?
It's a very simple extension that I've made mostly using ChatGPT's help. Also I am a complete noob in JavaScript so don't except me to know anything about the codes.
I was trying to run the extension ...
1
vote
0
answers
169
views
How way to click a button within #shadow-root (closed) via Python and Selenium
`I want to automate a web scraping. But, I couldn't click a button to resolve ReCAPTCHA with extension Buster. The button is a #shadow-root(closed).
Button to resolve ReCAPTCHA
`from selenium import ...
1
vote
0
answers
552
views
Save full page in Firefox as HTML complete web page from a custom button
I am developing a Firefox's button that performs several actions I use to do frequently in a sequence. One of the actions is to save the web page as HTML, but implementing this action is creating ...
1
vote
1
answer
155
views
Calling an extension from another extension: save full page as HTML complete web page
I am developing a Firefox's button that performs several actions I use to do frequently in a sequence. One of the actions is to save the web page as HTML, but implementing this action is creating ...
1
vote
0
answers
889
views
EvalError: call to eval() blocked by CSP in Mozilla firefox extention
My chrome extension is working fine and i want to make it compatible with Firefox as well. In the extension i have used eval method that is throwing error "EvalError: call to eval() blocked by ...
0
votes
0
answers
161
views
How to add custom build extension permanently on firefox modifying the source code
I need to build a firefox browser with custom configurations such as modifying the brand name, log etc. I successfully modified name and logo but could not figure out how to add a custom extension ...
0
votes
0
answers
74
views
load the extension as Firefox starts
I am trying to load the extension in firefox which I have build in windows. Here I have downloaded the firefox nightly source code and made my own extension. Now, I want to load the extension as soon ...
0
votes
1
answer
498
views
ModifyHeaders with UpdateDynamicRules doesn't work on firefox using manifest v3
I'm currently migrating my extension from manifest v2 to manifest v3 which is used to modify headers from HTTP requests.
So I use the declarativeNetRequest.updateDynamicRules from the chrome api that ...
0
votes
0
answers
407
views
script to overwrite fetch is not working using chrome.scripting.executeScript
I am trying to run a script to intercept fetch requests from background.js. I am using chrome.scripting.executeScript in order to run the script.
chrome.contextMenus.onClicked.addListener((info, tab) =...
1
vote
1
answer
258
views
how to view background logs of a firefox extension on Android?
I am debugging a firefox extension for android. I have latest firefox nightly build installed in both Windows PC and phone. I connect my phone to Windows, and go to about:debugging on Windows. I can ...
10
votes
2
answers
3k
views
Firefox extension Manifest v3 - request permission to "access your data for all websites" at runtime
Can a Manifest v3 Firefox extension request the "Access your data for all websites" permission from the user at runtime?
This option is usually managed in the firefox about:addons built-in ...
0
votes
1
answer
2k
views
How to prevent previously added event listeners from being called?
I am creating a content script as a browser extension.
I wish to change the functionality of some of the page, and I have thus identified I need to stop certain events. Normally, one could register an ...
2
votes
1
answer
43
views
How to execute a page's function from firefox add-on
I have a website that I want to automatically navigate through, so I decided to see if I can write a firefox add-on.
I have the following code:
manifest.json
{
"description": "...
1
vote
1
answer
310
views
Content Security Policy blocking Google API for addon
I am writing an addon for Firefox and have problem with Content Security Policy. It needs accessibility to Google API when I press button on it, so I have added following script tag to popup.html
<...
0
votes
0
answers
35
views
Firefox addon that writes to a file without user interaction
I would like to make a firefox addon that takes scroll bar position every 10 seconds and records it into a file.
So far, I just want to write "Hello world" to a file, every 10 sec, to start ...
0
votes
0
answers
161
views
Firefox add-on only inject the content page at popup click - why?
I have an Manifest V3 extension that works fine with Chrome/Edge etc. But for Firefox it does not inject the content page before I open the popup window - why?
In the popup I have no code to launch ...
0
votes
0
answers
22
views
How to reference variable I can access from console in firefox extension code? [duplicate]
I'm currently working on a firefox extension for a specific trusted website. I would like access to a variable "ownUsername" that I can access from the console. However, I am unable to ...
0
votes
1
answer
732
views
webRequest.filterResponseData() always gives error "Invalid request ID"
I am trying to get the response body from an API call made by a website in a Firefox extension. I am trying to do that with the webRequest API. Every time I try to do so, the resulting filter gives me ...
1
vote
0
answers
312
views
How to write/create a local text file inside of a firefox profile through a firefox extension?
I need to be able to create and write to a text file inside of the Firefox profile folder repeatedly (a couple times a minute). It is being done through the background script of an extension and it ...
0
votes
2
answers
853
views
How do I set my SVG icons' background to be transparent?
Update:
My interpretation of the problem was incorrect. Rather than the background turning black, the stroke was being scaled incorrectly. It just appeared to have a black background. I have reported ...
0
votes
0
answers
72
views
Browser loading unrelated (non-existent) file when registering a service worker in an extension
I'm registering a service worker in an extension, but getting a TypeError because the browser is trying to load my service worker file as a path of the website in addition to my extension's file.
...
0
votes
1
answer
548
views
JavaScript for Firefox Add-on/Extension: "failed to execute script: Error: Permission denied to access property "document" on cross-origin object"
I am looking forward to receive some help on this little but tedious problem of mine that seems I am not currently able to solve since a few weeks so far.
I am trying to develop a very easy/simple ...
0
votes
0
answers
119
views
How to block a request in an asynchrounous way inside a Firefox add-on?
I'm working on a minimal dyi ad-blocker in a form of a firefox add-on.
This is a project for my courses, so I need to be quite specific on a solution.
The solution goes like this:
Catch every request
...