I made a web app in React which i wanted to use as a chrome extension. But when I load the build folder and click on the icon I get a small white box and nothing else
Can someone please tell me what I did wrong.This is my manifest.json
{
"manifest_version": 2,
"name": "name",
"description": "desc",
"version": "0.0.1",
"browser_action": {
"default_popup": "index.html",
"default_title": "Open App"
},
"content_security_policy": "script-src 'self' 'sha256-OJ+UtHOO3C5swdxKPX5j37pdN56CatocDV87+5UMu9Q='; object-src 'self'", "permissions": [
]
}
Related
I'm going to make a program that inserts HTML code into a specific tag on a web page through Chrome Extension MV3.
I would like to use jquery to do the above work. However, I searched on Google and found that it did not show how to do it in the Manifest V3 environment.
How do I get jquery from Chrome Extension Manifest V3?
//manifest.json
{
"name": "test",
"description": "Build an Extension!",
"version": "1.0",
"manifest_version": 3,
"background": {
"service_worker": "background.js"
},
"permissions": ["storage", "activeTab", "scripting", "activeTab","tabs"],
"action": {
"default_popup": "popup.html"
}
}
recently I came across an error during trying to get JQuery to my chrome extension. I wrote following code and then when I try to reload my extension in Chrome browser I get the message:
Failed to load extension
Error
Could not load javascript 'jquery.js' for content script.
Could not load manifest.
The file of jquery was downloaded from their webpage (compressed production 3.5.1).
I checked several webpages connected to this problem but I couldn't find the solution.
Files in which inserting JQuery matters are below:
manifest.json
https://ideone.com/EGKlfQ
"manifest_version": 2,
"name" : "name",
"version": "1.0",
"offline_enabled": true,
"content_scripts": [
{
"matches": [
"https://www.zalando-lounge.pl/*"
],
"js": ["jquery.js","content.js"]
}
],
"background" : {
"scripts": ["background.js"]
},
"browser_action":{
"default_icon": "img/icon.png",
"default_popup": "popup.html",
"default_title": "A popup will come here"
},
"permissions": ["tabs","storage"],
"content_security_policy": "script-src 'self' https://cdnjs.cloudflare.com/; object-src 'self'"
popup.html
https://ideone.com/exMgYq
<script type="text/javascript" src="jquery.js"></script>
...other code in this file doesn't matter in this case...
I am developing a chrome extension using react which has a background script and multiple browser action js files. This is my project structure
MyExtension
|__build
|__public
| |__images
| |__scripts
| |__index.html
| |__manifest.json
|
|__src
|
|___browser action js files...
And this is my manifest.json
{
"name": "MyExtension",
"version": "0.0.1",
"manifest_version": 2,
"description": "MyExtension",
"icons": {
"16": "images/icon-16.png",
"128": "images/icon-128.png"
},
"default_locale": "en",
"background": {
"scripts": [
"scripts/background.js"
],
"persistent": false
},
"permissions": [
"background",
"notifications",
"tabs",
"storage",
"alarms",
"webNavigation",
"*://*/"
],
"browser_action": {
"default_icon": {
"16": "images/icon-16.png",
"19": "images/icon-19.png",
"38": "images/icon-38.png",
"128": "images/icon-128.png"
},
"default_title": "MyExtension",
"default_popup": "index.html"
},
"web_accessible_resources": [
"images/icon-48.png"
],
"content_security_policy": "script-src 'self' 'sha256-
5As4+3YpY62+l38PsxCEkjB1R4YtyktBtRScTJ3fyLU='; object-src 'self'"
}
I use the command npm run build for building the project where build is set to react-scripts build. Earlier, I used to debug the browser action files by inspecting the extension popup and setting breakpoints in js files under the src directory in the Source directory of the chrome developer tools window. I used to debug the background script by clicking on the background page link in the chrome://extensions page which is shown in the image below.
But recently, I notice that the browser action source files are not present under the 'Sources' tab as shown in the image below.
I just get two chunk.js files which seem to be the bundled version of all my files in the src directory. They have a lot of auto-generated code and hence I am not able to set breakpoints in the files I want.
Is there any way for me to get the individual source files to appear in the Sources tab of the Developer Tools Window?
Hi I made a little chrome extension for my self to use and wanted to publish it so i can put it on my portfolio.When i had it locally everything worked fine but after trying to download the publish version and trying to open the popup it says
"Your file was not found It may have been moved or deleted.
ERR_FILE_NOT_FOUND"
this is my manifest
{
"manifest_version": 2,
"name": "",
"description": "",
"version": "1.0",
"browser_action": {
"default_icon": "icon.png",
"default_popup": "index.html"
},
"background": {
"scripts": ["background.js"]
},
"permissions": [
"background",
"activeTab",
"storage",
"tabs",
"http://*/*",
"https://*/*"
]
}
these are my files that i compressed to upload
background.js
icon.png
index.html
main.js
manifest.json
style.css
I turned off all my other extensions to make sure it wasn't the other extension causing the problem
Do I need to reference the auth.js in my manifest for this code to work?
I am building a Google Chrome Extension that will provide a YouTube video in a popup after querying YouTube. To do this with javascript, I am told that I must first set up an auth.js.
I built the auth.js just as mentioned here. I made sure to get a project id from the Developer Console.
Here is my manifest.json
{
"manifest_version": 2,
"name": "myOverlay",
"description": "This extension will create a popout that links to a video specific to the current webpage",
"version": "1.0",
"permissions": [
"tabs",
"https://*.youtube.com/",
"https://*.ytimg.com/"
],
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"content_security_policy":
"script-src 'self' https://*.youtube.com https://*.ytimg.com; object-src 'self'"
}
No, just reference auth.js from popup.html like normal.
Any files within the extension directory are found automatically, you don't need to tell the manifest about them.