Skip to content
Advertisement

Tag: chrome-extension-manifest-v3

chrome.runtime.getURL() unable to inject javascript file into my webpage for manifest V3

Background: I’m making a chrome extension, and I must migrate it to MV3. I modified my manifest.json file to include web resources, but when I go to inject my resource from my content script using chrome.runtime.getURL, it says it can’t find my file. Specifically… GET: Chrome-extension:://”the_url/inject_script.js” net::ERR_FILE_NOT_FOUND I’m using the content root path to my web resource (javascript elements I

How to use VueRouter in Chrome Extension

I’ve been making a chrome extension with Vue 3 + VueRouter. With the router.push functionality I was trying to change router-view content to a different component, meaning showing a different UI to users. However, no matter what methods I use, I just can’t change the view. So my App.vue has router-view and I have two components that I would like

Manifest v3 inject script from popup.js

In manifest v2 this code worked and injected the script when button was clicked: popup.js v2 (works) Now in manifest v3, chrome.tabs.executeScript is replaced with chrome.scripting.executeScript. scripting permission is added in manifest.json. popup.js v3 (not working) The problem is that chrome.tabs.executeScript requires tabId value as one of the parameters. How can I get tabId value in popup.js or convert the

Chrome Extension – Getting CORS error when trying to fetch() from background script with manifest v3

I’m getting a CORS error when I try to do a request from my Chrome Extensions’s background script. The background script is bundled with webpack. Note: If I convert manifest.json to version 2 – all works fine. But with v3 it gives Access to fetch at ‘https://example.com/api/user/login’ from origin ‘chrome-extension://exampleid’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is

Chrome extension manifest v3 Content Security Policy

I am trying to load (inject) in page a javascript code. The javascript file is local to the extension. the filepath is ‘js/somefile.js’. My web accessible resources are: The error that I get is: Answer You can resolve the inline execution error by changing scriptTag.innerHTML = scriptText; to scriptTag.src = chrome.runtime.getURL(filePath);, no need to fetch the script. Manifest v3 seems

Advertisement