My extension shows up in Chrome, how can I stop this? - google-chrome-extension

So I am learning how to make chrome extensions. What I am trying to do is only useful at one specific website, so I hoped that I can somehow "hide" the extension when I am not at this website. It seems like Chrome Remote Desktop or Google docs extensions also don't show up next to the adress bar. How can I achieve the same with my extension? Here is my manifest:
{
"name": "Test",
"description" : "I am learning",
"version": "1",
"manifest_version": 2,
"content_scripts": [
{
"matches": ["*://www.google.com/*"],
"js": ["myscript.js"]
}
]
}

Related

Is my manifest.json fully compliant to Manifest v3?

Recently, I have been working on a Chrome plug-in with co-workers and I must admit that I do not have much experience with Chrome extensions. We already published one version. Now, I just submitted a second release.
I am aware that following the Manifest v3 rules helps to speed up the review process. Also, I believe we are following the rules and we really need to have a fast review process.
However, I keep seeing this message:
It points to the official documentation on the topic: Migrating to Manifest v3 which includes a check-list.
This message makes me suspicious that I might have made some mistakes.
Hence, I would like to show my manifest.json:
{
"name": "My plug-in name",
"description": "Auto-fill some specific forms",
"version": "0.0.22",
"manifest_version": 3,
"action": {
"default_popup": "src/importer/popup.html",
"default_icon": "src/importer/img/company-logo.png"
},
"icons": {
"128": "src/importer/img/company-icon.png"
},
"permissions": ["activeTab", "scripting"],
"background": {
"service_worker": "src/importer/background.js"
},
"content_scripts": [
{ "js": ["src/importer/content-script.js"],
"matches": ["https://*.onewebsite.com/*"] }
]
}
It seems to be correct.
Am I missing something? Is the extension Manifest V3 compliant?
Should I ignore Chrome Web Store alert?

Load the Unpacked Extension But It does not work

I was trying to incorporate something like Nicholas Cage into one of my projects related to google extension. My confusion is when I loaded the extension on google chrome, it seems that it did not load the jpg file related to Nicholas on my chrome. It supposed to work in the same way as the extension on the google chrome app store's Nicholas Cage. Here is my code for the nicholas cage. Here is my manifest json file:
{
"name": "Getting Started Example",
"version": "1.0",
"description": "Build an Extension!",
"content_scripts": [{
"js": ["ncage.min.js", "ncage.js"],
"matches": ["http://*/*", "https://*/*"]
}],
"manifest_version": 2}

Avoid creation of browser action in Chrome extension [duplicate]

This question already has answers here:
Can I hide my extension's icon by default?
(4 answers)
Closed 5 years ago.
I am creating a chrome extension. When the extension is added to chrome, then icon next to address bar is added also (browser action). My extension does not need any browser action. So, how can I avoid creation of this icon?
Edit: My manifest file:
{
"background": {
"persistent": true,
"scripts": [ "background.js" ]
},
"description": "This extension ...",
"manifest_version": 2,
"name": "Something",
"permissions": [ "webRequest", "webRequestBlocking", "http://*/*",
"https://*/*" ],
"version": "1",
"icons": {
"128": "msdos.png"
}
If your browser extension does not need browser_action, you can simply remove it from your manifest.json see: from https://developer.chrome.com/extensions/browserAction.
It will remove the icon next to the bar address.
More details about manifest.json: https://developer.chrome.com/extensions/manifest
If it does not work, do you mind to post your manifest.json
EDIT: As wOxxOm mentionned, since January 2016, Chrome shows all the icons of the web extension. So there is no way to hide it (except on the older version of Chrome).

Download url chrome extension

I am trying to download a url by writing code for chrome extension. Here is the myscript.js file:
chrome.downloads.download(
{url: 'http://www.iana.org/_img/iana-logo-pageheader.png',
saveAs: true
},
function(res){alert(res);});
and here is my manifest.json
{
"name": "My extension",
"version": "1.0",
"manifest_version":2,
"background_page": "background.html",
"browser_action": {
"name": "Manipulate DOM",
"icons": ["icon.png"],
"default_icon": "icon.png"
},
"permissions": ["downloads",
"tabs", "http://*/*","https://*/*"
],
"content_scripts": [
{
"matches": [ "http://*/*", "https://*/*"],
"js": ["jquery.js","d3.v2.js","myscript.js"],
"run_at": "document_end"
}
]
}
but the console is showing the error "Cannot call method 'download' of undefined".
Please help me.
The documentation for chrome.downloads clearly states that the "API is still under development. It is only available for Chrome users on the dev early release channel." (emphasis mine, currently at Chrome 23).
To use the API, you need to get a dev or canary build of Chrome (see this page for download links).
Another way to solve the problem is by not using the chrome.downloads API. I've been using the following method to create downloads, and it works like a charm (it works anywhere: Content script / background page / popup / whatever):
var a = document.createElement('a');
a.href = 'http://www.iana.org/_img/iana-logo-pageheader.png';
a.download = 'iana-logo-pageheader.png'; // Filename
a.click(); // Trigger download
a.click() causes Chrome to follow the link.
The download attribute causes Chrome to download the target, and suggest the attribute's value as a file name in the Save As dialog.
This feature is not limited to Chrome extensions, you can also use it in an ordinary web page. Have a look at this demo: http://jsfiddle.net/dEeHF/.

Can I use a chrome extension to add a widget to my website?

I'm playing with chrome extensions, trying to learn how to use them.
Is it possible for me to write an extension which injects a widget into my website whenever someone with the extension visits it? Can you recommend a sample application or tutorial that I can look at, which showcases something like this?
You can only inject JavaScript and CSS through Chrome extensions.
To inject the script or css your manifest.json should look something like this:
{
"name": "Website addon",
"version": "1.0",
"manifest_version": 1,
"description": "Addon for your website",
"content_scripts": [
{
"matches": ["*://yourWebsite.com/*", "*://*.yourWebsite.com/*"],
"js": ["yourJS.js"]
"css": ["yourCSS.css"]
}
]
}
This will add yourJS.js and yourCSS.css to all websites on yourWebsite.com
Here is a link to a tutorial from google: http://code.google.com/chrome/extensions/content_scripts.html

Resources