From 8497459444697482d517ce63c521977f9f23b7b4 Mon Sep 17 00:00:00 2001 From: JSC Date: Thu, 2 Oct 2025 14:07:28 +0200 Subject: [PATCH] Refactor config button click handler to open options page in a new tab --- popup.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/popup.js b/popup.js index 3e622f8..807f2b5 100644 --- a/popup.js +++ b/popup.js @@ -8,6 +8,11 @@ document.addEventListener('DOMContentLoaded', async () => { const videoTitle = document.getElementById('video-title'); const videoUrl = document.getElementById('video-url'); + // Config button click handler (needs to work regardless of page) + configBtn.addEventListener('click', () => { + chrome.tabs.create({ url: chrome.runtime.getURL('options.html') }); + }); + // Check if we're on YouTube const [tab] = await chrome.tabs.query({ active: true, currentWindow: true }); @@ -134,11 +139,6 @@ document.addEventListener('DOMContentLoaded', async () => { } }); - // Config button click handler - configBtn.addEventListener('click', () => { - chrome.runtime.openOptionsPage(); - }); - function showStatus(message, type) { status.textContent = message; status.className = `status ${type}`;