aboutsummaryrefslogtreecommitdiff
path: root/popup.js
diff options
context:
space:
mode:
authorTheArchons <github@thearchons.xyz>2026-01-26 15:09:56 -0500
committerTheArchons <github@thearchons.xyz>2026-01-26 15:09:56 -0500
commita2f267b080ef775ea62a5f32a547612aa482f009 (patch)
tree720214dd731347e6aed236c79daa48732f40f5f2 /popup.js
parent53dae4c861f2343be00f7154d06f24555d200d1a (diff)
Add initial implementation of Unhook NG extension with manifest, popup, and content scripts
Diffstat (limited to 'popup.js')
-rw-r--r--popup.js48
1 files changed, 48 insertions, 0 deletions
diff --git a/popup.js b/popup.js
new file mode 100644
index 0000000..816f785
--- /dev/null
+++ b/popup.js
@@ -0,0 +1,48 @@
+const toggles = [
+ 'hideHomeFeed',
+ 'hideVideoSidebar',
+ 'hideRecommended',
+ 'hideLiveChat',
+ 'hidePlaylist',
+ 'hideFundraiser',
+ 'hideEndScreenFeed',
+ 'hideEndScreenCards',
+ 'hideShorts',
+ 'hideComments',
+ 'hideProfilePhotos',
+ 'hideMixes',
+ 'hideMerchTickets',
+ 'hideVideoInfo',
+ 'hideButtonsBar',
+ 'hideChannel',
+ 'hideDescription',
+ 'hideTopHeader',
+ 'hideNotifications',
+ 'hideInaptSearch',
+ 'hideExploreTrending',
+ 'hideMoreFromYT',
+ 'hideSubscriptions',
+ 'disableAutoplay',
+ 'disableAnnotations'
+];
+
+// Load saved settings
+browser.storage.local.get(toggles).then((result) => {
+ toggles.forEach((id) => {
+ const checkbox = document.getElementById(id);
+ if (checkbox) {
+ checkbox.checked = result[id] !== false;
+ }
+ });
+});
+
+// Save settings on change
+document.addEventListener('change', (e) => {
+ if (e.target.type !== 'checkbox') return;
+
+ const id = e.target.id;
+ const checked = e.target.checked;
+ const settings = { [id]: checked };
+
+ browser.storage.local.set(settings);
+});