Questions tagged [web-extension]

Web Extension is API for major browser extension(plugin) development. Use this tag together with browser specific tags google-chrome-extension firefox-addon-webextensions safari-web-extension when you target all browsers and care for compatibility.

Browser Web Extension becomes standard for browser extension/plugin/addon development. Originally developed in Chrome, it was later adopted by Firefox and Edge, and in 2021 by Safari.

However as of 2021 there is no vendor neutral spec, and every browser has its own documentation. W3C WebExtensions Community Group (WECG) https://github.com/w3c/webextensions/ is ongoing effort for standardization.

87 questions
0
votes
0 answers

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.href doesn't work. How do I do this using a Content…
0
votes
0 answers

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 want to customize based on the active tab of the…
Gangula
  • 5,193
  • 4
  • 30
  • 59
0
votes
0 answers

How can a Safari Web Extension perform authentified 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 be able to use the Fetch API to send requests to…
Dalzhim
  • 1,970
  • 1
  • 17
  • 34
0
votes
0 answers

Why is my Manifest V3 service worker fetch failing due to "?Wikipedia schema:isPartOf " in URL?

I'm working on a browser extensions that calls the WikiData SPARQL API and it works with my Manifest V2 Firefox extension, but the same call in my Manifest V3 Chrome extension "failed to fetch" with the status as "(blocked:other)" and no other…
DLang
  • 1
  • 2
0
votes
0 answers

Firefox EXTENSION_ID_REQUIRED on manifest.json

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 the web-ext tool, specifically version…
0
votes
1 answer

Uncaught TypeError using MathJax in a JavaScript file

I am trying to write a browser extension for Firefox and want to use MathJax to show Mathematics in WhatsApp Web using Tex Notation. Whenever I try to load MathJax though, I get the following error: The Error Code displayed in Firefox This is the…
0
votes
0 answers

I need an access to a Variable in VariableGroup in Azure DevOps for a Web Extension written in Html/JavaScript

I need to Know with full sample how to set and read the values of variable from variable group in project library in azure devops from external html page that used as web extension in the project My Extension Manifest { "manifestVersion": 1, …
0
votes
1 answer

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 registering my plugin with my command like…
vicovicovico
  • 358
  • 1
  • 4
  • 16
0
votes
1 answer

In a web extension content script, how can I inject and run a script before anything else?

On certain sites, when modal dialogs are open, interacting with our content script UI is affecting the 'outside click' handlers for the webpage's modals, causing them to close My intent is to add 'capture phase' event listeners to the root-most…
0
votes
0 answers

WebExtension - how to send context menu selectionText to popup action?

I'm trying to get a context menu webextension working which sends the selected text to the popup/action page of the extension, using message passing. (I know I could display the selection into the page tab using executeScript with something like an…
wesinat0r
  • 121
  • 8
0
votes
1 answer

Userscript @match & @exclude to match paths at certain level, but not sublevels

How can one use @match and @exclude rules in a userscript to match URLs that have an arbitrary path at a certain level (a "level" being each new / in the path, not sure if there's a more technical name for it), but not at sublevels (i.e. having…
0
votes
0 answers

Cross-origin isolation in a Firefox extension

In Chrome, one can make an extension cross-origin isolated by adding the following to manifest.json: { ... "cross_origin_embedder_policy": { "value": "require-corp" }, "cross_origin_opener_policy": { "value":…
0
votes
0 answers

How to add custom header to each request in chrome extension

I would like to attach an id to each request going out via my extension. I have tried: browser.webRequest.onBeforeSendHeaders.addListener( function (details) { const headers = details.requestHeaders ?? [] headers.push({ …
Bruno Francisco
  • 3,841
  • 4
  • 31
  • 61
0
votes
0 answers

How can we communicate between background and a content script running in world MAIN

I have a content script (running in world MAIN) that is listening to changes in console.log and it should send a message to background.ts when a console.log happens. manifest.json { "content_scripts": [ { "world": "MAIN", "js":…
0
votes
0 answers

Uncaught (in promise) Error: Cannot access contents of the page. Extension manifest must request permission to access the respective host

I'm building an Chrome Extension Manifest Version 3. I get this error when I try installing it. Here are the important parts of my manifest.json: "permissions": ["storage", "tabs", "identity", "scripting"], "host_permissions":…