add background listener for sidebar

This commit is contained in:
buzz-lightsnack-2007 2024-04-27 10:54:49 +08:00
parent bec1de898e
commit 4c604581bd

View file

@ -1,8 +1,21 @@
import Sidebar from '/scripts/GUI/sidepanel.js'
export default class ManagedSidebar {
constructor () {
// WIP
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() {
}
}