Questions for development related to Google Chrome extension using manifest version 2. Questions related to it should specify what manifest version being used as each version has its own syntax that is not supported by other version.
Questions tagged [chrome-extension-manifest-v2]
76 questions
15
votes
2 answers
Embedding images into a Chrome extension
I'm building a Google Chrome extension, which injects HTML into a real web page. The injection contains also images and now I wonder how to refer to images within the extension. So far I was able to only refer them on a server using…

Kaspi
- 3,538
- 5
- 24
- 29
14
votes
2 answers
How to import js file to background.js in chrome extension from the same folder
I'm having a problem importing the file "score.js" that is in same library of the "background.js" (scripts libary).
I'm new to both js and chrome extensions.
I looked into require.js and did this.
Background.html:
…

CodeSlayer55
- 141
- 1
- 1
- 4
5
votes
1 answer
Default Icons in manifest for Chrome Extension
I have this piece of code in my manifest:
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html",
"default_icon": {
"16": "images/16x16.png",
"48": "images/48x48.png",
"128": "images/128x128.png"
} …

Bob Aleena
- 450
- 1
- 6
- 16
4
votes
1 answer
Why must MV3 Chrome extensions (using Service Workers) "register listeners in the first turn of the event loop"?
So I am in the process of migrating a MV2 extension which used persistent Background pages to MV3. In the Chrome migration guide [https://developer.chrome.com/docs/extensions/mv3/migrating_to_service_workers/#event_listeners]
it says :
In order for…

Kritidipto Ghosh
- 111
- 6
3
votes
2 answers
Chrome Extension Question: How to open popup_1.html if a statement is true, else open popup_2.html if a statement is false?
I'm new in developing Chrome Extensions and a beginner in JavaScript.
I need help in my chrome extension project.
Either if/else or a switch statement would be okay. I can't find a solution so far.
I need my popup to show popup_1.html if the…

Benz Tagle
- 33
- 3
3
votes
0 answers
Chrome Extension connection with the app is not working
Working on a project where an app needs to connect with a chrome extension that needs to migrate from manifest v2 to v3.
Detail: In manifest v2 inside the background.js we inject the script (which contains some dataset) that gets the file from…

Hassam Saeed
- 385
- 5
- 24
3
votes
1 answer
Chrome extension get display information of active screen
I am creating a chrome extension that can fetch display information [ screen-dimension ] on click-on extension. and I got success in it using, following API
chrome.system.display.getInfo();
This API is giving information all attached displays […

Dinesh Patil
- 396
- 1
- 4
- 14
2
votes
0 answers
Why is a web_accessible_resource able to access other non - web_accessible_resource in chrome extension?
I have a chrome MV3 extension that I am developing locally.
Now I have a content script that injects an iframe into a user site.
The iframe's html src is a sample.html file whose url we get using…

Kritidipto Ghosh
- 111
- 6
2
votes
1 answer
Why i am getting chrome-extension://invalid/ error when trying to load local font
I start a chrome extension that is triggered on instagram.com.
I wanted to load a local font but when I open the extension I get this error when font is loading
GET chrome-extension://invalid/ net::ERR_FAILED
In my network tab when font is loading…

Alan_
- 35
- 6
2
votes
0 answers
How to make chrome extension 'optional permissions' dialog pop up locally?
I'm trying to get this
optional permission dialog to pop up locally while testing
I've been following this official tutorial:
https://developer.chrome.com/docs/extensions/reference/permissions/
In my case, the optional permission dialog should…

Himanshu Ragtah
- 21
- 4
2
votes
0 answers
chrome.browsingData.remove or chrome.cookies.remove not deleting all cookies
In my chrome extension, I want to remove everything. I am using this code
chrome.browsingData.remove({
"since": 0
}, {
"appcache": true,
"cache": true,
"cacheStorage": true,
"cookies": true,
"downloads": true,
"fileSystems": true,
…

Irfan Alam
- 476
- 3
- 9
- 25
1
vote
0 answers
why does chrome.tabs.sendMessage behave differently in mv3 and mv2 when used inside tabs.onUpdated?
I have a chrome MV3 extension .
In the background script i am sending a message to the new tab opened onTabUpdated .
In content script I am responding to message.
background.js
chrome.tabs.onUpdated.addListener(function (tabId, info, tab) {
…

Kritidipto Ghosh
- 111
- 6
1
vote
0 answers
Using chrome.declarativeNetRequest to update the First Document (HTML) Fetch request call
We have an array of tab ids stored in chrome storage, using those I wanted to modify the user-agent of the First Document Fetch call on a webPage of those tabs.
i am using chrome.declarativeNetRequest API to dynamically update the rules with new Tab…

Arshansh
- 21
- 3
1
vote
1 answer
File selection dialog popup underlays behind chrome extension popup window
In my browser extension, I am trying to upload a file from my computer. When I click on "select a file" option inside my browser (), the file selection dialog box underlays behind the popup window.
This appears only when the browser is in full…

Sonali Agrawal
- 21
- 2
1
vote
2 answers
Strange behaviour in React component that includes message listener
I'm working on a component for a chrome extension that needs to listen for messages passed from other parts of the extension and update the display based on those messages.
A simplified version of what I thought should work is below but it does not…

Urza
- 219
- 1
- 8