From 68e6be32f04b801bb7ec47c49294eeb94f9c418c Mon Sep 17 00:00:00 2001 From: Tronax Date: Fri, 15 May 2026 21:20:15 +0200 Subject: [PATCH] Fix for rebased files --- content.js | 47 ------------------------------------ manifest.json | 14 ----------- popup.html | 66 --------------------------------------------------- popup.js | 41 -------------------------------- 4 files changed, 168 deletions(-) delete mode 100644 content.js diff --git a/content.js b/content.js deleted file mode 100644 index ae04667..0000000 --- a/content.js +++ /dev/null @@ -1,47 +0,0 @@ -let gainNode = null; -let audioCtx = null; -let sourceMap = new WeakMap(); - -function setVolume(percent) { - const factor = percent / 100; - document.querySelectorAll('video, audio').forEach(el => { - if (!sourceMap.has(el)) { - if (!audioCtx) { - audioCtx = new AudioContext(); - } - try { - const src = audioCtx.createMediaElementSource(el); - const gain = audioCtx.createGain(); - src.connect(gain); - gain.connect(audioCtx.destination); - sourceMap.set(el, gain); - } catch (e) { - // Element bereits in einem anderen Context - return; - } - } - sourceMap.get(el).gain.value = factor; - }); -} - -// Beim Laden: gespeicherten Wert anwenden -chrome.storage.local.get('volume', ({ volume }) => { - if (volume !== undefined) setVolume(volume); -}); - -// Auf Nachrichten vom Popup hören -chrome.runtime.onMessage.addListener(({ volume }) => { - if (volume !== undefined) setVolume(volume); -}); - -// Neue Media-Elemente automatisch erfassen -const observer = new MutationObserver(() => { - chrome.storage.local.get('volume', ({ volume }) => { - if (volume !== undefined && volume !== 100) { - setVolume(volume); - } - }); -}); -observer.observe(document.body, { - childList: true, subtree: true -}); diff --git a/manifest.json b/manifest.json index 0ce30d5..b11e101 100644 --- a/manifest.json +++ b/manifest.json @@ -1,20 +1,6 @@ { "manifest_version": 3, "name": "Volume Booster", - "version": "1.0", - "description": "Boost audio up to 600%", - "permissions": ["activeTab", "storage"], - "action": { - "default_popup": "popup.html", - "default_title": "Volume Booster" - }, - "content_scripts": [ - { - "matches": [""], - "js": ["content.js"] - } - ], - "author": "Tronax mail@tronax.dev", "version": "1.0.0", "description": "Boost or lower the volume of any browser tab — up to 600%. Mit schönem Interface.", "permissions": ["activeTab", "tabs", "storage", "tabCapture", "offscreen"], diff --git a/popup.html b/popup.html index 9799242..792767f 100644 --- a/popup.html +++ b/popup.html @@ -1,71 +1,6 @@ -<<<<<<< HEAD - - - - -

VOLUME BOOSTER

-
- 100% -
- -
- 0% - 200% - 400% - 600% -
- -======= Volume Booster @@ -153,7 +88,6 @@

Über 100 % wird der Tab-Ton verstärkt.

->>>>>>> 2056a0d (First Commit, Code by Claude 4.7 Opus) diff --git a/popup.js b/popup.js index 2203138..9e057ec 100644 --- a/popup.js +++ b/popup.js @@ -1,43 +1,3 @@ -<<<<<<< HEAD -const slider = document.getElementById('slider'); -const display = document.getElementById('display'); -const reset = document.getElementById('reset'); - -// Gespeicherten Wert laden -chrome.storage.local.get('volume', ({ volume }) => { - const val = volume ?? 100; - slider.value = val; - display.textContent = val; -}); - -// Schieberegler bewegen -slider.addEventListener('input', () => { - const val = parseInt(slider.value); - display.textContent = val; - chrome.storage.local.set({ volume: val }); - - // Aktiven Tab anweisen - chrome.tabs.query( - { active: true, currentWindow: true }, - ([tab]) => { - chrome.tabs.sendMessage(tab.id, { volume: val }); - } - ); -}); - -// Zurücksetzen auf 100% -reset.addEventListener('click', () => { - slider.value = 100; - display.textContent = 100; - chrome.storage.local.set({ volume: 100 }); - chrome.tabs.query( - { active: true, currentWindow: true }, - ([tab]) => { - chrome.tabs.sendMessage(tab.id, { volume: 100 }); - } - ); -}); -======= // ============================================================ // Volume Booster — Popup Logic // ============================================================ @@ -181,4 +141,3 @@ document.addEventListener("keydown", (e) => { }); init(); ->>>>>>> 2056a0d (First Commit, Code by Claude 4.7 Opus)