Refactor config button click handler to open options page in a new tab

This commit is contained in:
JSC
2025-10-02 14:07:28 +02:00
parent fbf398a227
commit 8497459444

View File

@@ -8,6 +8,11 @@ document.addEventListener('DOMContentLoaded', async () => {
const videoTitle = document.getElementById('video-title'); const videoTitle = document.getElementById('video-title');
const videoUrl = document.getElementById('video-url'); 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 // Check if we're on YouTube
const [tab] = await chrome.tabs.query({ active: true, currentWindow: true }); 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) { function showStatus(message, type) {
status.textContent = message; status.textContent = message;
status.className = `status ${type}`; status.className = `status ${type}`;