From 13104bb6e88a0f5ae6a6a6e1ff98dd59aeac229d Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 6 Mar 2019 18:47:25 -0500 Subject: [PATCH] more compat checks for chrome permissions api --- src/browser/browserApi.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/browser/browserApi.ts b/src/browser/browserApi.ts index a7255e0ef0..d5807cef36 100644 --- a/src/browser/browserApi.ts +++ b/src/browser/browserApi.ts @@ -298,7 +298,7 @@ export class BrowserApi { static hasPermission(permissionName: string): Promise { return new Promise((resolve) => { - if (BrowserApi.isSafariApi) { + if (BrowserApi.isSafariApi || !chrome.permissions || !chrome.permissions.contains) { resolve(true); } else { chrome.permissions.contains({ @@ -312,7 +312,7 @@ export class BrowserApi { static requestPermission(permissionName: string): Promise { return new Promise((resolve) => { - if (BrowserApi.isSafariApi) { + if (BrowserApi.isSafariApi || !chrome.permissions || !chrome.permissions.request) { resolve(true); } else { chrome.permissions.request({