How to set a key combination as a browser toolbar shortcut?

1

0


For example, something like:

  • CTRL+SHIFT+DEL
  • CTRL+T
  • CTRL+E

...or whatever else. I'd like to have an icon in my browser's toolbar that when clicked executes such a key combination.

Is this directly possible, or would it require creating a plugin? If it would require creating a plugin, how might that be done?


p.s. — I'm using Firefox, but it would be awesome if there was a browser-independent solution.

EDIT: @crazypotato has a good solution for CTRL+SHIFT+DEL as being a link to chrome://browser/content/sanitize.xul in Firefox, but I'm thinking of something that might function more like a keyboard macro.

Ian Campbell

Posted 2014-08-25T03:54:54.737

Reputation: 239

You want create shortcut on bookmark toolbar for hotkey CTRL+SHIFT+DEL what will execute "clear browser history" while CTRL+SHIFT+DEL already execute "clear browser history"? Why you cant make bookmark on url "clear browser history" for firefox (chrome://browser/content/sanitize.xul) for chrome (chrome://settings/clearBrowserData). This question hurt me alot:( Why you can't ask for way to execute "clear browser history" in bookmark toolbar. – crazypotato – 2014-08-25T09:48:56.177

@crazypotato OK chrome://browser/content/sanitize.xul works, wasn't aware of that, thanks! My question is misleading, because I'm more curious if a link could execute any possible key combination, not just CTRL+SHIFT+DEL. Edited just now -- – Ian Campbell – 2014-08-26T05:19:52.117

Instead you should find how execute function behind hotkey and use it. – crazypotato – 2014-08-26T11:13:58.383

Answers

1

This can be done using URI scheme but this very not safe and not worth using it. Unless make white list and block everything else for executable files.

First you should register URI scheme for example with this app (windows executable). This app from Local Explorer - File Manager for Chrome, open files and folders on local directories or network shares. Then you can run any file from your drive using any browser.

For next step need create script with Autoit or AHK for send keys.

After install Autoit and Editor. Right click on desktop->New->Autoit Script. Right click on this created file->Edit. Now you should see ScITE window and after line "Add your code below here" add this code:

#NoTrayIcon
send("^+{DEL}")

This script send keys(ctrl+shift+delete) to active window(click on send and press F1 for help). Then in SciTE window press Tools->Build. Now you will get executable in same directory where was Autoit script.

For execute file in browser you should run in address bar or add to bookmark this url:

localexplorer:[full path to executable]

Example:

localexplorer:C:\sendkeys.exe

For each combination of hotkeys you should create own Autoit script.

crazypotato

Posted 2014-08-25T03:54:54.737

Reputation: 678

I will have to research this, thanks @crazypotato! – Ian Campbell – 2014-08-30T02:54:05.267