add background listener for sidebar
This commit is contained in:
parent
bec1de898e
commit
4c604581bd
1 changed files with 17 additions and 4 deletions
|
@ -1,8 +1,21 @@
|
|||
import Sidebar from '/scripts/GUI/sidepanel.js'
|
||||
|
||||
export default class ManagedSidebar {
|
||||
constructor () {
|
||||
// WIP
|
||||
new Sidebar(`/pages/popup.htm`);
|
||||
}
|
||||
static manage() {
|
||||
chrome.runtime.onMessage.addListener(
|
||||
function(request, sender, sendResponse) {
|
||||
if (request.action.includes("sidebar_open")) {
|
||||
ManagedSidebar.enable();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
static enable() {
|
||||
new Sidebar(`/pages/popup.htm`);
|
||||
}
|
||||
|
||||
disable() {
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue