How can I enable/disable any chrome extension at particular time automatically even during my sleep.
This is possible by creating another extension with chrome.alarms.create to define the times and chrome.management.setEnabled to toggle the extensions.
Related
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 disable a specific extension programmatically from my own extension?
"Extensity" chrome extensions programmatically disables extensions, so you can try giving a look at its code (if it is not obfuscated).
I'm writing an extension for Google Chrome which is supposed to be used only with selected pages, hence it uses page_action script. I find myself in need to perform some cleanup, either when my extension becomes inactive or when it activates, so that each subsequent use starts with "clean state" for the user.
Is it possible with current Chrome extension APIs? If yes, where should I look? chrome.runtime appeared to be obvious place for such functionality, but upon checking the only candidate there, onSuspend() event, it didn't do what I wanted (namely, the activation/deactivation of page_action extension doesn't seem to trigger it).
I know how to manually enable panels in Chrome.
I have written a chrome extensions that uses panels. Unfortunately users have to enable that manually first.
chrome.windows.create({type:"panel", url: temp, width:pos.w,height:pos.h, top:pos.top, left:pos.left}, function (_win) {
win = _win.id;
});
Question: is it possible to have panel feature enabled for an extension WITHOUT having to do that manually?
You can't from within an extension, period.
Chrome flags are experimental features and you should never assume that they are present.
If you have some sort of external installer, you could modify Chrome's shortcuts to include the --enable-panels flag; but that's considered browser hijacking and is unreliable (Google constantly pushes against malware that uses similar techniques).
At least with chrome.tabs.create you can specifically open chrome://flags/#enable-panels after explaining to your user to enable it.
It isn't documented yet, but panels are enabled by default for Chrome OS apps since 45. You will need to split functionality and use external messaging. On other systems, you can fallback to an alwaysOnTop window (alwaysOnTopWindows permission). You will need to put it in the lower right yourself.
chrome.app.window.create("test.html", { alwaysOnTop: true, type: "panel" })
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.