Questions tagged [webextension-polyfill]

18 questions
4
votes
2 answers

Failed to load file: "browser-polyfill.js"

I was trying out this webextension-polyfill example to executeScript using tabs.executeScript and I get an error message: Uncaught(in promise) Failed to load file: "browser-polyfill.js" This is the example code I am referring…
3
votes
1 answer

Unable to create a vue-web-extension from vue-cli

Currently, I am modifying a chrome extension I have built to adding a popup page that is developed in Vue. I am using this tutorial, https://www.streaver.com/blog/posts/create-web-extension-vue.html. Whenever I try the step vue init…
2
votes
0 answers

Axios error : TypeError: adapter is not a function

I'm making a web extension using webextension-polyfill and vuejs (axios for requesting). I needed to make requests from my content script but it threw my cors errors, so I forwarded thoses requests to the background script. But axios thew me that…
patacoing
  • 87
  • 1
  • 10
1
vote
0 answers

How to access chrome.runtime from svelte project

I am building a svelte browser extension, and in order to load images, I found out that I can use chrome.runtime.getURL(relative_path), which is well supported across browsers. So, I wrote this code:
1
vote
1 answer

Could not load content for chrome-extension://gighmmpiobklfepjocnamgkkbiglidom/browser-polyfill.js.map: System error: net::ERR_FILE_NOT_FOUND

I'm trying to run a login page on my Laravel project, but I get this error on the console : DevTools failed to load source map: Could not load content for chrome-extension://gighmmpiobklfepjocnamgkkbiglidom/browser-polyfill.js.map: System error:…
rajah
  • 23
  • 4
1
vote
1 answer

How to use browser.storage.sync in ContentScript with webextension-polyfill

I have been developing a browser extension in vaniall JS till now. I would like to use vite + Vue moving forward. Upon doing a google search I found this GitHub repository which help with this. I'm trying to set the user preferences and save them in…
Gangula
  • 5,193
  • 4
  • 30
  • 59
1
vote
0 answers

Browser Extension Manifest v3 with webextension-polyfill does not allow browser.browserAction.onClicked (on Chrome)

I am building a browser extension. I want to trigger a notification when the user clicks on the extension's icon. When I try to load the extension in Chrome, I get this error: Service worker registration failed As the source of the error, it…
1
vote
2 answers

browser.alarms is undefined using webextension-polyfill

I'm trying to create an alarm using browser.alarms API for web extensions. To make the extension cross-browser, I am using webextension-polyfill and testing on Chrome. My code to create an alarm within a background script is shown…
1
vote
1 answer

Accessing variables in browser.runtime.getBackgroundPage()

I'm currently building a browser extension with create-react-app as the base, trying to use getBackgroundPage() instead of the messaging API to communicate between the background scripts (I have 3 defined) and the new tab page, but it seems like…
1
vote
0 answers

tabs.executeScript encounters ReferenceError when accessing a function defined in Content Script

Update: It seems the problem comes from the fact that Webpack executes each module in its own function, meaning that no modules can exist in the global scope. Is there any elegant way to solve this problem, so that I can define a function in a…
0
votes
1 answer

How do the updates get applied to the extensions published for Google Chrome and Edge

I am developing a browser extension for Chrome and Edge using webextension's polyfill. I intend to roll out few improvement related hot fixes and bugs after 1st release[that is to an already published app]. For Chrome I have found…
0
votes
0 answers

How to add `Referer` header to network calls being made in extensions made using manifest V3?

I had developed a chrome extension using manifest v3. I am opening an iframe in the content script and from the iframe few network calls are being made. I see that those calls do not have Referer header with them. To resolve this I had used…
0
votes
0 answers

sendMessage fails to return result when migrating from Manifest V2 to V3

My extension is based on manifest V2, and is cross-browser compatible basing on browser-polyfill. I need to migrate to manifest V3. There are many communications between context and background using sendMessage in the extension. As written in many…
0
votes
0 answers

Chrome extension: context parameter in chrome.contextMenus.create is being ignored

So I got this piece of code from my extension (I'm currently using webextension polyfill), it successfully creates the context menu and it's accessible when in foo.bar, The issue is in the browser_action context menu, it's always there, I've…
0
votes
0 answers

Firefox - webRequest.onBeforeSendHeaders

I'm getting this in Firefox while in Chrome the same works Error: Type error for parameter filter (Error processing urls.0: Expected string instead of undefined) for webRequest.onBeforeSendHeaders. import browser from "webextension-polyfill"; …
1
2