move the user actions file

This commit is contained in:
buzz-lightsnack-2007 2024-04-23 22:45:58 +08:00
parent 78178b98af
commit b6869a7d61
4 changed files with 24 additions and 8 deletions

View file

@ -1,7 +0,0 @@
export default class user_actions {
static init() {
chrome.sidePanel
.setPanelBehavior({ openPanelOnActionClick: true })
.catch((error) => console.error(error));
};
};

14
scripts/actions/tabs.js Normal file
View file

@ -0,0 +1,14 @@
import Tabs from "/scripts/GUI/tabs.js";
import Entry from "/scripts/external/entry.js"
export default class Watcher_Tabs {
constructor () {
Tabs.addActionListener(`update`, this.check);
};
check(data) {
if ((data.tab) ? data.tab.url : false) {
Entry.manage(data.tab);
}
}
}

View file

@ -0,0 +1,9 @@
import Watcher_Tabs from "./tabs.js";
export default class user_actions {
static init() {
chrome.sidePanel.setPanelBehavior({ openPanelOnActionClick: true }).catch((error) => console.error(error));
new Watcher_Tabs();
};
};

View file

@ -3,7 +3,7 @@ Shop wisely with AI!
*/
import fc from './fc.js';
import user_actions from "./GUI/user_actions.js";
import user_actions from "./actions/user_actions.js";
fc.run();
user_actions.init();