Surfingkeys
Surfingkeys copied to clipboard
How to create a command to execute Javascript?
Hi. First of all, thanks for a great tool! I absolutely love it!
Is there a way to create a command which will execute some Javascript? I want to do:
map(';ggl', 'window.location.replace('https://www.google.com');
But this just executes google.com when settings are loaded and every tab goes there.
You can use mapkey
// Bind to g H
api.mapkey('gH', 'Say Hi', function() {
//Your code
alert("Hi");
});
API is here
Many examples could be found at https://github.com/brookhong/Surfingkeys/blob/master/src/content_scripts/common/default.js