Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Setup publishing to AMO * Fix notifications-service-test * Push minimium browser requirements, drop CSS * Drop babel, partially fix requesting permissions * Release on cron, triggered builds, and on tags * Fix permissions forever - Remove on tags for Travis build - Rename option `newTabAlways` to `reuseTabs` - Move permissions requests to options - Remove some tests and respective dependencies - Fix failing tests * Extract out options syncing * Fix error propagation * Update options screenshot * Delay showing successive notifications on Firefox
- Loading branch information
Showing
22 changed files
with
192 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,17 @@ | ||
export async function queryPermission(permission) { | ||
const granted = await browser.permissions.contains({permissions: [permission]}); | ||
|
||
if (browser.runtime.lastError) { | ||
throw new Error(browser.runtime.lastError); | ||
try { | ||
return browser.permissions.contains({permissions: [permission]}); | ||
} catch (error) { | ||
console.log(error); | ||
return false; | ||
} | ||
|
||
return granted; | ||
} | ||
|
||
export async function requestPermission(permission) { | ||
const granted = await browser.permissions.request({permissions: [permission]}); | ||
|
||
if (browser.runtime.lastError) { | ||
throw new Error(browser.runtime.lastError); | ||
try { | ||
return browser.permissions.request({permissions: [permission]}); | ||
} catch (error) { | ||
console.log(error); | ||
return false; | ||
} | ||
|
||
return granted; | ||
} |
Oops, something went wrong.