0

I am working on a chrome extension that allows users to open the browser_action by
pressing a keystroke that THEY have assigned from the options-page.

I would like to use document.onkeyup = function(){ Chrome.runtime.openPopup(); };
or something along those lines... I know that this Particular Extension API
(runtime.openPopup) only functions for mozilla firefox. I am building this extension
for Chrome & Opera so this is not an option for me.

How might I go about this? Would it be through adding chrome.commands API to
the manifest file; then modifying that file from options.html/options.js and reloading the extension? I've looked all over for a way to do the method explained above and it doesn't seem
like that's possible.

Yes, Yes I know that Chrome has a built in method for customizing chrome extension
keyboard shortcuts, but like I said I want the user to be able to specify the
shortcut from the options.html page & I'm developing this extension for Opera
too. So that won't really work...

Any solutions?

I've tried Content.js--chrome.runtime.sendMessage
& Popup.js--chrome.runtime.onMessage.addeEventListener(function() {self.focus();});

255.tar.xz
  • 700
  • 7
  • 23
  • 1
    Not possible in stable Chrome. Open a new small window instead or insert an iframe into the current page with your UI page declared in web_accessible_resources in manifest.json – wOxxOm Sep 24 '18 at 04:44
  • Well Darn... That sucks. Will the Iframe Have Access to chrome.executescript API? – 255.tar.xz Sep 24 '18 at 12:19
  • Yes, the iframe can access everything any other extension page can. And in addition to that you can use chrome.tabs.getCurrent inside the iframe to get the web page tab object, which is pretty convenient. – wOxxOm Sep 24 '18 at 12:25

0 Answers0