mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-13 06:57:09 +03:00
Add page for refreshing invidious permissions if it was revoked
Fixes #1354
This commit is contained in:
@@ -12,25 +12,17 @@ window.addEventListener('DOMContentLoaded', init);
|
||||
async function init() {
|
||||
localizeHtmlPage();
|
||||
|
||||
const domains = document.location.hash.replace("#", "").split(",");
|
||||
|
||||
const acceptButton = document.getElementById("acceptPermissionButton");
|
||||
acceptButton.addEventListener("click", () => {
|
||||
chrome.permissions.request({
|
||||
origins: utils.getPermissionRegex(domains),
|
||||
permissions: []
|
||||
}, (granted) => {
|
||||
if (granted) {
|
||||
utils.applyInvidiousPermissions(Config.config.supportInvidious).then((enabled) => {
|
||||
Config.config.supportInvidious = enabled;
|
||||
|
||||
if (enabled) {
|
||||
alert(chrome.i18n.getMessage("permissionRequestSuccess"));
|
||||
|
||||
Config.config.ytInfoPermissionGranted = true;
|
||||
|
||||
chrome.tabs.getCurrent((tab) => {
|
||||
chrome.tabs.remove(tab.id);
|
||||
});
|
||||
window.close();
|
||||
} else {
|
||||
alert(chrome.i18n.getMessage("permissionRequestFailed"));
|
||||
}
|
||||
});
|
||||
})
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user