15 lines
445 B
JavaScript
15 lines
445 B
JavaScript
function doInCurrentTab(tabCallback) {
|
|
chrome.tabs.query(
|
|
{ currentWindow: true, active: true },
|
|
function (tabArray) { tabCallback(tabArray[0]); }
|
|
);
|
|
}
|
|
|
|
chrome.commands.onCommand.addListener(function(command) {
|
|
if (command === "start") {
|
|
chrome.tabs.query({active: true, currentWindow: true}, function(tabs){
|
|
chrome.tabs.sendMessage(tabs[0].id, {action: "start_keyhinter"});
|
|
});
|
|
}
|
|
});
|