Is there any known way to access the shortcut key that activates an extension? The documentation (https://developer.chrome.com/docs/extensions/reference/commands/) states that _execute_action is explicitly not part of the commands extension API and I'm wondering about a possible reason. My use case is to use the bound shortcut within the extension for further interactions.
Related
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 have a chrome extension I am working on, which lives in a devtools panel (http://developer.chrome.com/extensions/devtools.panels.html).
I want to add a button to quickly open up my extension. I added a browser_action button just fine, but I can't find any information on launching developer tools from a browser action.
Is there a way to open developers tools and switch to my pane from a browser action button?
It seems unlikely that this is possible or will ever become possible. From Chromium Issue 112277:
We only allow explicit devtools opening.
While the issue described there is slightly different from your use case, your needs still seem to run contrary to the requirement of "explicit dev tools opening".
I read "explicit devtools opening" to mean "only open devtools when the user explicitly requests devtools". This reading is incompatible with allowing extension buttons to open developer tools. You could have a button that appeared to do something (say, redirect you to a website) but when clicked, actually opened developer tools -- you've just opened dev tools without the user explicitly asking for it, which is inconsistent with my reading of "explicit devtools opening".
Consider the theoretical statement, "We only allow explicit deletion of user data." Certainly that directive would preclude allowing an arbitrary extension button from deleting user data, wouldn't it? Even if the user explicitly clicked on a button, they didn't explicitly opt to perform a delete.
Perhaps you could read "explicit devtools opening" more loosely to mean "open devtools only in direct response to user action" which would leave open the possibility of future support for this functionality.
Chrome extension development: I am using the chrome.commands to specify certain global shortcuts.
If I specify a shortcut that overrides a default browser shortcut (for which I have a good reason!), things work fine mostly, i.e. my extension's action gets invoked instead of the browser's default.
However in an incognito window, invoking this shortcut neither invokes my extension's action (which is okay since the extension is disabled there by default), nor the browser's overridden action. (If I allow the extension in incognito mode, my shortcut works fine again as expected.)
Before I file a bug for this, I wanted to check if there's a way to fix this myself.
Related: Using chrome.commands is there a way to make keyboard event not prevent the default action, as one happens by default with regular DOM events?
Is it possible to create a browser extension that would allow page-controlled window opacity? Not so that various elements on the page are of a given opacity, but to allow one to see other windows (like the desktop) behind the browser page.
Thank you.
No, this is not possible in an extension. Such transparency would be handled at the window manager level, and would require platform-specific code. This means that either Chrome would have to add this feature and expose it as an extension API (currently no such feature exists), or you would have to write a plugin.
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.