mirror of
https://github.com/FranP-code/wii-shop-extension.git
synced 2025-10-12 23:52:52 +00:00
Initial popup UI and music picker
This commit is contained in:
File diff suppressed because one or more lines are too long
18
js/popup.js
Normal file
18
js/popup.js
Normal file
@@ -0,0 +1,18 @@
|
||||
// Save settings
|
||||
document.querySelector('#music-picker').addEventListener('change', function () {
|
||||
chrome.storage.local.set({
|
||||
music: document.querySelector('#music-picker').value
|
||||
})
|
||||
})
|
||||
|
||||
// Get stored settings
|
||||
chrome.storage.local.get(function (data) {
|
||||
document.querySelector('#music-picker').value = data.music;
|
||||
})
|
||||
|
||||
// Button link functionality
|
||||
document.querySelectorAll('button[data-link]').forEach(function (el) {
|
||||
el.addEventListener('click', function () {
|
||||
chrome.tabs.create({ url: el.getAttribute('data-link') })
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user