Skip to content
This repository was archived by the owner on Nov 15, 2017. It is now read-only.

Commit b40c1ba

Browse files
Keyboard shortcut listener
I just put it in start.js. Don't know if you want it here.
1 parent ec5b918 commit b40c1ba

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

js/start.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,18 @@ function clearBrowserCacheCallback() {
172172

173173
HTTPSB.asyncJobs.add('clearBrowserCache', null, clearBrowserCacheCallback, 15 * 60 * 1000, true);
174174

175+
/******************************************************************************/
176+
177+
chrome.commands.onCommand.addListener( function( command ) {
178+
var extensionURL;
179+
switch ( command ) {
180+
case 'open-statistics': extensionURL = 'dashboard.html#statistics'; break;
181+
case 'open-ubiquitous-rules': extensionURL = 'dashboard.html#ubiquitous-rules'; break;
182+
case 'open-scoped-rules': extensionURL = 'dashboard.html#scoped-rules'; break;
183+
case 'open-settings': extensionURL = 'dashboard.html#settings'; break;
184+
}
185+
if ( extensionURL ) {
186+
chrome.runtime.sendMessage( { what: 'gotoExtensionURL',
187+
url: extensionURL } );
188+
}
189+
});

0 commit comments

Comments
 (0)