I tried to make an useless extension so I could map CTRL W to "open" this extension instead of closing the tab. When I click Load Unpacked the folder with the manifest.json it loads the extension without any errors but the extension doesnt show up at all... Did I do something wrong?
manifest.json:
{
"name": "CTRLW",
"manifest_version": 2,
"version": "1.0",
"icons": { "128": "128.png" }
}
Related
Given a Chrome extension that sets up a browser_action based on a default_icon click, how can that extension print to the console? For example, say my manifest.json includes this:
{
"name": "Testing",
"version": "1.0",
"browser_action": {
"default_popup": "testing.html",
"default_icon": "icon.png"
},
"manifest_version": 2
}
and my testing.html loads a <script> with some Javascript:
console.log("WHY DON'T I SEE THIS??");
Why doesn't this print anything to the console? And how might I go about getting something printed to the console?
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'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"
}
}
Hi I have found other similiar questions on stackoverflow but none of them solved the purpose.
I want my chrome extension/app to be opened in a full tab like how POSTMAN extension is opened.
My manifest.json
{
"name": "Sample App",
"manifest_version": 2,
"version": "0.0.1",
"app": {
"background": {
"scripts": ["main.js"]
}
},
"icons": { "128": "icon.png" },
"permissions" : ["tabs" ]
}
My main.js (alias for background.js)
chrome.app.runtime.onLaunched.addListener(function() {
chrome.tabs.create({'url': chrome.extension.getURL('index.html')}, function(tab) {
alert("Hi");
});
});
index.html is the file i want to load on opening the new tab.
My first time responding here on stackoverflow, please be gentle...
I discovered that it's much easier to add "launch" : { "local_path" : "index.html" } within the manifest.json file. See my sample manifest file below.
{
"manifest_version" : 2,
"name": "Hello World!",
"description": "My first Chrome App.",
"version": "0.1",
"app": {
"launch" : {
"local_path" : "index.html"
}
},
"icons": { "16": "icon.png" }
}
Keep in mind that this example is very basic, it has been stripped of some unnecessary information such as a background script but it should accomplish what you want.
http://developer.chrome.com/apps/first_app.html
chrome.app.runtime.onLaunched is only for Chrome apps, not extensions. The code for your background page will automatically run when the Chrome browser starts, so you can start directly with chrome.tabs.create(...).
Also, you need to include index.html and any resource included in your extension that the page will use in a web_accesible_resources section in your manifest.
I am loading an unpacked extension but I am unable to see any thumbnails for my extension under chrome://settings/extensions?
Whether I should add anything in manifest file?
Here is my manifest file..
{
"name": "a1",
"version": "1.0",
"description": "a1",
"background_page": "background.html",
"browser_action": {
"default_icon": "icon.png",
"popup": "popup.html"
}
}
browser_action.default_icon is only the icon for the button next to the omnibar. If you want an icon in chrome://settings/extensions you need to set the icon value.