Refactor config button click handler to open options page in a new tab
This commit is contained in:
10
popup.js
10
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}`;
|
||||
|
||||
Reference in New Issue
Block a user