I am trying to create a google chrome extension. Below is the code of the manifest file.
{
//Required
"manifest_verion": 2,
"name": "File to BASE64 Converter"
"version": "1.0",
//Recommended
"description": "Created By Eric Pan",
"icons": {
"128": "favicon.png"
},
//Type of action: Browser,Page, or none
"browser_action": {
"default_title" "An Application Developed By Eric Pan"
"default_popup": "popup.html"
},
}
All google tells me is that there is an error in line 3, but I can't find the solution. If you could help, that would be great!
Related
I've been learning how to make a Chrome extension and have been stuck on just adding an icon for a while now, I've copy pasted code that supposedly works but I keep getting this error:
Could not load icon 'icon16.png' specified in 'icons'.
Could not load manifest.
My code:
{
"manifest_version": 3,
"name": "extension",
"description": "test",
"version": "1.0",
"browser_action": {
"default_icon": "icon48.png"
},
"icons": {
"16": "icon16.png",
"48": "icon48.png",
"128": "icon128.png"
},
"content_scripts": [
{
"js": [
"test.js"
],
"matches": [
"https://www.test.com/*"
]
}
]
}
I've triple checked that every image is in fact a PNG and is of the right size. I have a single directory with manifest.json, test.js, and all three images (as well as a.prettierrc file, although I doubt that has any impact).
If I remove the icons part of manifest.json the extension works perfectly.
The error about not being able to load the manifest is likely related to:
"browser_action": {
"default_icon": "icon48.png"
},
which is from Manifest Version 2. The "browser_action" field should be changed to:
"action": {
"default_icon": "icon48.png"
},
For further reference see here: Action API unification
I have created a Chrome extension and published it to the Chrome Web Store. I noticed with my initial version that when a user tried to install it they would get the warning that my extension could "read and change all your data on the websites you visit". I've changed and republished my extension so that I don't think that warning should be displayed, but it still gets displayed. Based on the information at https://developer.chrome.com/extensions/permission_warnings I don't think that message should be showing up. Below is what is in my manifest.json file. Any suggestions for how to make the warning go away?
{
"name": "Screen Recorder",
"description": "Record a video of your computer screen",
"version": "0.4",
"manifest_version": 2,
"icons": {
"16": "icon.png",
"128": "icon.png"
},
"background": {
"scripts": [
"background.js",
"ourrecorder.js"
]
},
"browser_action": {
"default_icon": "icon.png",
"default_popup": "receiver.html"
},
"permissions": [
"desktopCapture",
"tabCapture",
"notifications",
"unlimitedStorage"
]
}
So I was testing out chrome extensions and learning how to use them but I get the same error when I upload my code... It says
Failed to load extension from: ~\Desktop\chromeExtension
The 'manifest_version' key must be present and set to 2 (without quotes). See developer.chrome.com/extensions/manifestVersion.html for details.
I have a manifest.json file and icon.png file
manifest.json:
{
"name": "Hello World!",
"version": 2,
"description": "My first Chrome extension.",
"browser_action": {
"default_icon": "icon.png"
}
}
icon.png:
Can anyone tell me what I did wrong? I uploaded my chrome extension at the chrome://extension page, hit the developer mode button, pressed load unpacked extension, and then opened a file called chromeExtension containing the manifest.json and icon.png. Any ideas on how to fix the error?
You need to set the manifest_version, not just the version. The version key is simply the version of your extension:
{
"name": "Hello World!",
"version": "1.0",
"manifest_version": 2,
"description": "My first Chrome extension.",
"browser_action": {
"default_icon": "icon.png"
}
}
I already configured my chrome extension to send notification like this:
I have a button that has a event that call createNotification. But the button just send notification if I'm running the extension on apache.
What I'm doing wrong?
Is equal that example http://jsbin.com/ziwod/1/edit?html,js,output
And for me this example just work when I click in "Run with JS".
This is my manifest
{
"name": "EXTENSION EXAMPLE",
"version": "0.0.1",
"manifest_version": 2,
"description" : "This extension is...",
"icons": { "16": "icons/16x16.png", "48": "icons/48x48.png", "128": "icons/128x128.png" },
"omnibox": { "keyword" : "example" },
"browser_action": {
"default_icon": {
"19": "icons/19x19.png",
"38": "icons/38x38.png"
},
"default_title": "Launcher",
"default_popup": "browseraction/popup.html"
},
"background": {
"scripts": ["background.js"],
"persistent": false
},
"permissions" : ["notifications"],
"options_page" : "notification.html",
"chrome_url_overrides" : {
"newtab": "newtab/newtab.html"
},
"devtools_page": "devtools/devtools.html"
}
This is my notification.html http://codepen.io/anon/pen/VYWQwB
From your html file and the manifest file of "manifest_version": 2 is that Content Security Policy is enabled by default. And Chrome developers chose to be strict about it and always disallow inline JavaScript code - only code placed in an external JavaScript file is allowed to execute (to prevent Cross-Site Scripting vulnerabilities in extensions). So <button onclick="notifyMe()"> is not allowed in your html file. onclick attribute is an inline script. You should assign an ID attribute instead: <button id="button">.
I'm building my second chrome extension, and can't get the icons to load in development mode; everything is still a puzzle piece in chrome. I have triple-checked the path and that they are each the correct size. Any ideas on why they won't load? Here is the manifest.json
manifest.json:
{
"manifest_version": 2,
"name": "Wishlist",
"short_name": "Add things to your wishlist.",
"version": "1.0",
"browser_action": {
"default_title": "Wishlist",
"default_icon": "icons/16x16.png"
},
"icons": {
"16": "icons/16x16.png",
"48": "icons/48x48.png",
"128": "icons/128x128.png"
}
}