Initial popup UI and music picker

This commit is contained in:
Corbin Davenport
2021-11-26 20:15:44 -05:00
parent a65d87f414
commit 785e61622d
10 changed files with 119 additions and 12 deletions

File diff suppressed because one or more lines are too long

18
js/popup.js Normal file
View 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') })
})
})