make dashboard accesible from everywhere to Plugin Click, ctrl + enter just in domainspace
This commit is contained in:
parent
0c8ce940a8
commit
07f663abb0
5 changed files with 54 additions and 20 deletions
|
|
@ -1,3 +1,22 @@
|
|||
browser.browserAction.onClicked.addListener((tab) => {
|
||||
console.log(tab.url);
|
||||
});
|
||||
"use strict";
|
||||
|
||||
function onError(error) {
|
||||
console.error(`Error: ${error}`);
|
||||
}
|
||||
|
||||
function sendMessageToTabs(tabs) {
|
||||
for (let tab of tabs) {
|
||||
browser.tabs.sendMessage(
|
||||
tab.id,
|
||||
{overlay: "display"}
|
||||
).then(response => {
|
||||
}).catch(onError);
|
||||
}
|
||||
}
|
||||
|
||||
browser.browserAction.onClicked.addListener(() => {
|
||||
browser.tabs.query({
|
||||
currentWindow: true,
|
||||
active: true
|
||||
}).then(sendMessageToTabs).catch(onError);
|
||||
});
|
||||
Reference in a new issue