is there any way to disable a chrome extension but without hidding the icon - google-chrome-extension

i'm making a chrome extension with a toggle button that disable and enable the extension but the problem is that the extension icon hides when i click it.
i was thinking in a background extension but how I can add two extensions in the manifest.json..

The answer is simple: you can't! In a manifest.json you can only declare one extension and all the relative resources. The behaviour you want to achieve is not possible, because the icon will be removed from the chrome toolbar if an extension is deactivated, and it's not possible to change this.

Related

For a Chrome extension, can it control other extensions like turning them off?

I'm working on a project where I need to see the page I'm working on without any extension injected code messing up what I see. I want to know if I can create, or if there is currently, an extension that disables all other extensions for xyz page.
No, extensions can only disable other extensions entirely by using chrome.management.setEnabled API. It's like the on/off switch in chrome://extensions page.
The only way to exclude a certain site from being affected by all or some extensions is to add ExtensionSettings policy with runtime_blocked_hosts that contains that site. Note that the entire site is disabled, not just a single URL. Example: {"*": {"runtime_blocked_hosts": ["*://lastpass.com"]}}
A simple workaround for your use case may be to open that page in an incognito window or even in a new browser profile without extensions: click your avatar icon in the toolbar to access the profile tools where you can create and then open a new profile.

Is there a better way to keep removing and reloading "unpacked" chrome extension when doing development

Is there a better way to keep removing and reloading "unpacked" chrome extension when doing development? I found myself doing this for a very long period of time already and start to think this doesn't feel like the "right way" to develop it. There must be a way it would automatically "compile" right?
I use the following chrome extension to reload all unpacked chrome extensions during development, when pressing the extension icon in the topbar.
Extensions Reloader
Additionally the options page for the extension provides a feature to reload the active tab, when pressing the extension icon.
Hope it helps.

How can I reload my Chrome extension when it is not possible to do so from chrome://extensions because of my extension?

I'm testing out Chrome Extension development and was testing how to do a page redirect through Chrome Extension.
Well it works, but now because of that I can't access the extension settings page.
How do I manually reload/disable the extension? Or do that from the Mac terminal?
My Chrome is pretty much unusable now thanks to my own code.
Thank you!
Tee
Your question seems to be "How can I reload my Chrome extension when it is not possible to do so from chrome://extensions because of my extension?"
A possible answer is:
Press Shift + Esc to open the task manager (or click on the hamburger menu -> More tools -> Task manager).
Select your extension.
Click on the "End process" button.
Now you can visit chrome://extensions and reload your extension in the usual way.
The previous only works if there is an extension process, not if your extension is purely a content script extension. If you still want to use the above method, you can force an extension process to become visible by opening chrome-extension://[extension id here]/manifest.json in a new tab.

Can one Google Chrome extension have several browser action icons?

I've made an extension that adds one icon that shows a popup. But I need to show 2 icons. I've read the https://developer.chrome.com/extensions/browserAction but couldn't find a reference to any limitations on this regard. However in the manifest.json, I can only define one popup.
Is there a way for one extension to have several icons on the Chrome toolbar?
No. Each extension can have at most one browser action or page action. You could create multiple extensions that pass messages.

Shortcut for reloading extensions in Chrome

Is there any shortcut or an extension to reload extensions in Chrome? This is a really big pain while developing extension for Chrome.
I think the best way to do this is to actually open the popup in a page. To do this use the URL:
chrome-extension://{extension-id}/{page.html}
This allows you to use Chrome Developer tools and when you press refresh the extension is refreshed with the latest code changes. It also updated the extension popup.

Resources