Disable a specific Chrome extension for a specific page? - google-chrome-extension

Can I add code to a page that will disable an extension running on that specific page?
Yes, there are extensions and settings that will prevent an extension from running.
I'm trying to avoid those approaches and control it within the page itself where I don't want it to run.
Yes, I can add code to the page(s) where I want to disable.
Want to do this with Javasript or JQuery.

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.

chrome extension: which page getBackgroundPage() retrieve?

I am a little confused whether this api suits my need. I want a common place to view my logs, instead of going around to the popup's console, the background page's console, etc...
Then I noticed that you can include several background scripts. In which case, which page does the api give us?
Chrome does not support multiple background pages in a chrome extension. It supports multiple background scripts. But it does not supports both background page and background scripts at the same time. See below the screenshots.
Error shown when we try add background page and script at the same
time.
Error shown when we try add multiple background pages.
Now coming back to your question which page getBackgroundPage() retrieve?
Since chrome supports only one background page it will return the only page that you include in you manifest.json.

Is it possible to show chrome extension icon inside the web page?

Is it possible to show chrome extension icon inside the web page?I am able to create an extension using page action ,icon is shown inside the address bar ,but i need to show it inside the web page ...
Well, there is no special API you can simply use for that.
You can inject your own UI elements into the page, but it's going to be difficult. I will only outline this, don't ask for specific code.
You will need a Content Script (also, read the Architecture Overview page if you haven't yet) to access the contents of the page.
Then, you need to create and append your elements to the DOM of the page. In your case, you could possibly add an <img> tag with your icon and a click listener that does something.
Note that to avoid clashes with CSS of the page itself it is recommended to use Shadow DOM techniques.
Of course, this may or may not work well depending on the page you're injecting into.

How to get chrome to run extensions automatically?

I am trying to develop a chrome extensions. I've developed a few firefox extensions a few years ago. In firefox it was possible to automatically run your extension of the page, and alter the page's content (add HTML and style it). I'd like the extension to automatically change the html, without requiring the user to click a button up in the browser's window.
How to get chrome to run extensions automatically?
Thank you
You just have to declare a content script in your manifest.json, it will be automatically executed on all pages matching the corresponding URL pattern without any user interaction.

Is it possible to call one extension from another

I have Google Chrome and the extensions installed on it. I would like to reduce number of extension buttons on Chrome panel.
For this I want to create my plugin which will display popup window and allow to run another extension installed on my browser?
Is it possible and where I can find examples?
The messaging API has an external extension feature. You can use that communicate between extensions.

Resources