Compare commits
2 Commits
781b197f17
...
db0f1df790
Author | SHA1 | Date | |
---|---|---|---|
db0f1df790 | |||
64b0c4951e |
8
click.js
8
click.js
|
@ -1,15 +1,15 @@
|
|||
var sndsrc;
|
||||
var click = new Audio();
|
||||
browser.webNavigation.onBeforeNavigate.addListener((details)=>{
|
||||
if (!details.url.startsWith("moz-extension://") && !details.url.startsWith("about:")) {
|
||||
chrome.webNavigation.onBeforeNavigate.addListener((details)=>{
|
||||
if (!details.url.startsWith("moz-extension://") && !details.url.startsWith("about:") && !details.url.startsWith("chrome://")) {
|
||||
if (click.src) click.play();
|
||||
}
|
||||
});
|
||||
|
||||
browser.storage.local.get({sound: null}, function({sound}) {
|
||||
chrome.storage.local.get({sound: null}, function({sound}) {
|
||||
click.src = sound;
|
||||
});
|
||||
|
||||
browser.storage.local.onChanged.addListener((changes)=>{
|
||||
chrome.storage.local.onChanged.addListener((changes)=>{
|
||||
click.src = changes.sound.newValue;
|
||||
});
|
|
@ -6,7 +6,7 @@ sndInput.onchange = function(event) {
|
|||
reader.readAsDataURL(sndInput.files[0]);
|
||||
reader.onload = function () {
|
||||
sndTest.src = reader.result;
|
||||
browser.storage.local.set({sound: reader.result});
|
||||
chrome.storage.local.set({sound: reader.result});
|
||||
};
|
||||
reader.onerror = function() {
|
||||
window.alert(reader.error);
|
||||
|
@ -14,6 +14,6 @@ sndInput.onchange = function(event) {
|
|||
sndInput.value = "";
|
||||
}
|
||||
|
||||
browser.storage.local.get({sound: null}, function({sound}) {
|
||||
chrome.storage.local.get({sound: null}, function({sound}) {
|
||||
sndTest.src = sound;
|
||||
});
|
Loading…
Reference in New Issue
Block a user