116 questions
Best practices
0
votes
2
replies
93
views
Manifest v3 service workers: how to set up webrequest listeners for URLs defined by the users and stored in the storage?
This question is related to my question here, but it is still slightly different. However, it still concerns the problem that listeners must be registered during the first synchronous run, while the ...
0
votes
1
answer
116
views
Prevent browser extension background worker wakeups on tab removal after service restart
Let's say I'm creating a browser extension using MV3. This question involves the background service and the chrome.tabs.onRemoved event as an example, but presumably this would apply to other types of ...
0
votes
0
answers
53
views
Significance of WXT listed versus unlisted scripts for browser extensions
My understanding from the WXT documentation is that if I have a script named entrypoints/sidepanel/index.ts, this will be an "unlisted script". But if I rename it to entrypoints/sidepanel/...
2
votes
2
answers
57
views
Setting cookies not allowed in extension popup?
I'm trying to set a cookie in the popup page of my extension to no avail. I've tried two different methods...
First I used document.cookie, which doesn't do anything...
document.cookie = "SID=...
0
votes
1
answer
118
views
Getting around X-Frame-Options DENY in a Chrome extension? (2)
I have an iframe loading inside an extension page but unfortunately the document inside the iframe embeds its own iframes whose Content-Security-Policy I still can't circumvent with ...
0
votes
0
answers
22
views
How to use chromium extension shortcut to fill system clipboard?
I wrote simple chromium extension where I define command with keyboard shortcut:
"commands": {
"copy-to-clipboard": {
"suggested_key": {
"default&...
0
votes
0
answers
29
views
How to implement missing Safari `history.onHistoryStateUpdated()`?
Unfortunately, Safari does not support 'webNavigation.onHistoryStateUpdated', but i need it to be working in web extension. I had an idea of wrapping history.pushState() that will call ...
0
votes
0
answers
219
views
How to successfuly use Essentia.js library in the context of web extension
I'm trying to create a web extension using Web Audio API and Essentia.js.
Basically, the process I'm currently focused on is:
User inputs an audio file from device;
File is converted to the ...
0
votes
0
answers
73
views
How to set set badge text in web extension reliably with MV3
I recently converted a web extension to manifest v3. The extension is supposed to work in all browser, notably both chrome and firefox. It should always display a badge text, independent of the ...
1
vote
1
answer
120
views
How can I import Papaparse into Web Extension JavaScript code?
How can I include Papaparse so I can use it in Web Extension Javascript code?
I know this might be obvious to any experienced JavaScript programmer, but I am not very experienced with JavaScript. ...
0
votes
1
answer
35
views
Modify background script state from browser debug console
For my web extension I would like to have a "debug mode" which makes troubleshooting issues with the extension easier. By default this debug mode should be disabled, but it should be ...
0
votes
0
answers
22
views
Web extension `messages.json` translation include other translation from same file
For a web extension messages.json translation file, is it possible that a translation includes another translation? That would be useful when you want to avoid duplication.
For example something like:
...
0
votes
1
answer
184
views
Manifest v3 service workers: conditional registration of event listeners based on stored user settings is no longer possible?
I know I'm a little late to the game and have only just started porting my own extension from manifest v2 to v3, but I'm wondering why no one has pointed this out yet. At least I haven't found ...
0
votes
1
answer
50
views
Add Vibrant.js library to firefox web extension
I have a web extension for firefox based on manifest_version: 2. My extension interacts with the elements of a certain third-party site, sometimes modifying them or supplementing the interface with my ...
2
votes
0
answers
57
views
How to Customize Browser's PDF Viewer Without Changing the URL in the Omnibox
I'm trying to develop a browser extension to customize the PDF preview page. In the Stack Overflow question Chrome Extension: How to show custom UI for a PDF file, the main author of the PDF.js Chrome ...
0
votes
0
answers
39
views
Does the "identity" permission trigger a warning in a chrome extension?
I've added the "identity" permission to my extension to implement a "Continue with Google" feature, but I'm unsure if it will trigger a new warning. If it does, my extension will ...
1
vote
1
answer
129
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:...
-1
votes
1
answer
36
views
Not Standard Input behavior?
I'm trying to automate something with a browser extension, and I'm facing a problem with an input.
The thing is, I can't set that specific input value to anything from the extension. If I do it ...
2
votes
0
answers
99
views
Typescript and Chrome/web extensions: creating a d.ts file for content scripts' subset of @types/chrome
I'm a novice/intermediate user of typescript, so thanks in advance for any patience and assistance.
Chrome/web extensions' content scripts have access to a very limited subset of extension APIs and I'...
0
votes
1
answer
72
views
Get multiple response as Promise Array when sending message with chrome.tabs.sendMessage
When all_frames: true is set in manifest.json, the content script runs on all frames of the target page, but when a message is sent to the content script from another script, I would like to know how ...
0
votes
1
answer
93
views
In a WebExtension's background.js script, how can I access values from manifest.json?
Suppose I'm maintaining a WebExtension, with a Manifest V2 file. My extension has a background.js script which sets all sorts of things up. Now, I want to access arbitrary key-value pairs from my ...
0
votes
1
answer
65
views
My background.js is not recognizing tab being opened
I am writing a chrome extension to get the lyrics of the current song playing on spotify. The background.js file is not recognizing when a tab is opened.
console.log("Hi");
chrome.action....
0
votes
1
answer
127
views
How to align badge text to left/right in a browser extension
I'm working on a browser extension called Stack Me First where I add slightly longer badge text. But the first few letters of the text are important to be visible.
Currently the badge text is aligned ...
1
vote
0
answers
104
views
How do I detect if the user goes back or forward through the history in the current tab?
I'm going to implement a simple web extension for my personal needs (currently for Chrome, but I consider moving to Firefox and abandon the former), and this extension only requires the history and ...
1
vote
1
answer
124
views
how to make Webextension content_scripts load on opened pages after the first?
Problem: The content_scripts specified in the manifest.json of a WebExtension are only applied to the first page loaded in a window created by the extension regardless of how non-specific my matches ...
0
votes
1
answer
282
views
Safari hides image (modify image src) from my Web Extension
I have built a web extension for Chrome and Firefox. After that, I wanted to be able to use it on Safari as well.
For that, I used the xcrun command with the option safari-web-extension-converter.
Now,...
1
vote
0
answers
46
views
How to access JSON that another script requested?
If you use your browser's devtools you can easily see the JSON as a response to an XHR request in the Networking tab. How to access the same JSON in your own Javascript, e.g. from the context of an ...
2
votes
0
answers
711
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 ...
2
votes
1
answer
817
views
My service worker is not connecting to my content script in my Chrome extension. How do I fix this?
I have been working on porting this manifest v2 Chrome extension to manifest V3 and while I did port the extension through changing the structure in the manifest file and replacing the background.js ...
0
votes
1
answer
47
views
Chrome extension - Check if context/page is a options, Content Script devtools or windows?
Working on library, which executes differently in different contexts/pages i.e Popup, Options, Devtools, ContentScript & Windows for which we need to know which context the library is running in ...
0
votes
1
answer
55
views
Chrome Extensions - How to check if its a specific page ( Popup, Options, Devtools, Background, ContentScript )?
I am working on a library which needs to be called & executed in the background script only. How to check if the library is being executed in background script only ?
So, something like this :..
...
0
votes
0
answers
58
views
Access Chrome APIs in a web application built with ReactJS
I am creating a web application in ReactJS, and I want to access Chrome APIs such as chrome.proxy, chrome.management, and chrome.tabs in my web application.
function App() {
const onProxyConnect = ()...
1
vote
0
answers
240
views
Safari web extension manfiest.json bug
This is my chrome manifest.json file and it works perfectly fine for chrome, but when i convert the chrome extension to safari extension using xcrun safari-web-extension-converter ./my-chrome-...
1
vote
1
answer
513
views
Web-Eid and the Belgian eID
I am a student and I'm in internship.
Here is the project we are working for :
On a web application, we need the user to authenticate and signing documents with his/her Belgian eID.
We think of using ...
0
votes
1
answer
131
views
ParcelJs - building web extension manifest v3 doesn't resolve service_worker path
I'm building a cross-browser extension.
I see that Firefox doesn't support yet service workers, while they are mandatory for Chrome.
So, I was making some tests in Chrome but when I try to build the ...
1
vote
1
answer
224
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 (...
0
votes
0
answers
18
views
How can I work with the objects returned by 'tabs.query()'? [duplicate]
I have three tabs open, when I print activeTab, on the console I get:
let activeTab = browser.tabs.query({currentWindow: true})
...
0: Object { id: 1, index: 0, windowId: 1, … }
1: Object { id: 2, ...
0
votes
0
answers
65
views
Firefox Android: "Add-on is not supported"
I'm creating a private add-on for Firefox on Android. I can successfully launch the add-on using wex-ext run and use it, but it does not stay if Firefox is restarted.
I have also created a zip file of ...
-1
votes
2
answers
181
views
How to run a content_script without user click on WebExtension v3
I'm new to WebExtensions and trying to port a minimal example called borderify from v2 to v3.
I tried the minimal step of setting manifest.json's manifest_version: 3, but I quickly learned this breaks ...
0
votes
0
answers
388
views
Force Chrome autofill to actually fill fields
I am writing a web extension, and one task of it is to speed up the login process on a particular page by automatically submitting the credentials if the browser autofills them.
In Firefox I was able ...
0
votes
0
answers
46
views
[Web Extension]: How to hold url loading till the time Web Extension is processing
My web extension tries to intercept a web request for a particular url, at this point I want to set a cookie for this particular url. The issue i am facing is the lag caused due to delay in getting ...
0
votes
1
answer
1k
views
How can I console log the send/receive data of a websocket using Chrome Web Extension?
So what I'm trying to do is, using a chrome web extension, attach to a websocket connection, instead of creating a new connection, and console log the data which is being sent and received. My issue ...
2
votes
0
answers
89
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
99
views
A native webextension does not work in Firefox
The native app described here is not working for me, errors like:
Reading manifest: Warning processing XXX: An unexpected property was found in the WebExtension manifest.
Problematic XXX fields: ...
0
votes
0
answers
27
views
Replace webpage with Firefox Extension?
I'm trying to make a Firefox extension that sends you to a webpage when an offending word is found in the document title. I already have a webpage that I want to send them to, but document.location....
1
vote
0
answers
98
views
How to add a border around the badge in a browser extension
Is it possible to add a border around the extension badge for a web extension?.
I have developed a web extension called Stack Me First, I want the extension badge to have a border around it which I ...
4
votes
0
answers
428
views
How can a Safari Web Extension perform authenticated requests?
I am trying to create a Safari Web Extension that leverages a web service where authentication is required. My goal is to reproduce what is already working in both Chrome and Firefox, meaning I should ...
0
votes
0
answers
51
views
Firefox EXTENSION_ID_REQUIRED on manifest.json [duplicate]
I've recently built a script extension for Chrome using Manifest Version 3, and it's been working smoothly. Now, I'm attempting to create a Firefox version of the same extension. To do this, I'm using ...
2
votes
0
answers
112
views
Google Analytics in a web extension makes MS Edge unresponsive
I'm working on a web extension and trying to implement Google Anaytics 4 into the extension (not GTM).
I was able to successfully implement this functionality and tested it in Firefox successfully. ...
0
votes
1
answer
104
views
Selenium IDE : Can't record custom command from custom WebExtension
I'm trying to add some custom command using my homemade plugin like the documentation say we can: https://www.selenium.dev/selenium-ide/docs/en/plugins/plugins-getting-started
It is working fine, I am ...