Compare commits

..

No commits in common. "db0f1df7903d2454b5bd435d21de1d452bbb11ab" and "781b197f177ca562841df2ba4192012123653a77" have entirely different histories.

2 changed files with 6 additions and 6 deletions

View File

@ -1,15 +1,15 @@
var sndsrc; var sndsrc;
var click = new Audio(); var click = new Audio();
chrome.webNavigation.onBeforeNavigate.addListener((details)=>{ browser.webNavigation.onBeforeNavigate.addListener((details)=>{
if (!details.url.startsWith("moz-extension://") && !details.url.startsWith("about:") && !details.url.startsWith("chrome://")) { if (!details.url.startsWith("moz-extension://") && !details.url.startsWith("about:")) {
if (click.src) click.play(); if (click.src) click.play();
} }
}); });
chrome.storage.local.get({sound: null}, function({sound}) { browser.storage.local.get({sound: null}, function({sound}) {
click.src = sound; click.src = sound;
}); });
chrome.storage.local.onChanged.addListener((changes)=>{ browser.storage.local.onChanged.addListener((changes)=>{
click.src = changes.sound.newValue; click.src = changes.sound.newValue;
}); });

View File

@ -6,7 +6,7 @@ sndInput.onchange = function(event) {
reader.readAsDataURL(sndInput.files[0]); reader.readAsDataURL(sndInput.files[0]);
reader.onload = function () { reader.onload = function () {
sndTest.src = reader.result; sndTest.src = reader.result;
chrome.storage.local.set({sound: reader.result}); browser.storage.local.set({sound: reader.result});
}; };
reader.onerror = function() { reader.onerror = function() {
window.alert(reader.error); window.alert(reader.error);
@ -14,6 +14,6 @@ sndInput.onchange = function(event) {
sndInput.value = ""; sndInput.value = "";
} }
chrome.storage.local.get({sound: null}, function({sound}) { browser.storage.local.get({sound: null}, function({sound}) {
sndTest.src = sound; sndTest.src = sound;
}); });