diff --git a/src/config.ts b/src/config.ts index 2b2ad8ce..3afb029c 100644 --- a/src/config.ts +++ b/src/config.ts @@ -36,6 +36,7 @@ interface SBConfig { testingServer: boolean, hashPrefix: boolean, refetchWhenNotFound: boolean, + ytInfoPermissionGranted: boolean, // What categories should be skipped categorySelections: CategorySelection[], @@ -169,6 +170,7 @@ const Config: SBObject = { testingServer: false, hashPrefix: true, refetchWhenNotFound: true, + ytInfoPermissionGranted: false, categorySelections: [{ name: "sponsor", diff --git a/src/content.ts b/src/content.ts index dd219456..e4e3cb4f 100644 --- a/src/content.ts +++ b/src/content.ts @@ -733,7 +733,7 @@ async function getVideoInfo(): Promise { async function videoInfoFetchFailed(errorMessage: string): Promise { console.log("failed\t" + errorMessage) - if (utils.isFirefox()) { + if (utils.isFirefox() && !Config.config.ytInfoPermissionGranted) { // Attempt to ask permission for youtube.com domain alert(chrome.i18n.getMessage("youtubePermissionRequest")); diff --git a/src/permissions.ts b/src/permissions.ts index b6a41dce..558f0c3f 100644 --- a/src/permissions.ts +++ b/src/permissions.ts @@ -22,6 +22,8 @@ async function init() { if (granted) { alert(chrome.i18n.getMessage("permissionRequestSuccess")); + Config.config.ytInfoPermissionGranted = true; + chrome.tabs.getCurrent((tab) => { chrome.tabs.remove(tab.id); });