mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-08 20:47:11 +03:00
Properly ask for permissions when changing the server address
This commit is contained in:
@@ -72,7 +72,7 @@ async function init() {
|
|||||||
|
|
||||||
textChangeInput.value = Config.config[textChangeOption];
|
textChangeInput.value = Config.config[textChangeOption];
|
||||||
|
|
||||||
textChangeSetButton.addEventListener("click", () => {
|
textChangeSetButton.addEventListener("click", async () => {
|
||||||
// See if anything extra must be done
|
// See if anything extra must be done
|
||||||
switch (textChangeOption) {
|
switch (textChangeOption) {
|
||||||
case "serverAddress":
|
case "serverAddress":
|
||||||
@@ -84,6 +84,18 @@ async function init() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Permission needed on Firefox
|
||||||
|
if (utils.isFirefox()) {
|
||||||
|
let permissionSuccess = await new Promise((resolve, reject) => {
|
||||||
|
chrome.permissions.request({
|
||||||
|
origins: [textChangeInput.value + "/"],
|
||||||
|
permissions: []
|
||||||
|
}, resolve);
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!permissionSuccess) return;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user