aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/settings/anki-controller.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-01-30 15:05:08 -0500
committerGitHub <noreply@github.com>2021-01-30 15:05:08 -0500
commit828c4b11c14a13abe6ce352177ece341471e374f (patch)
treee08bd57aba64b95593dab87349127016df48c50f /ext/bg/js/settings/anki-controller.js
parenta802666d8dde251d996fee66b4d96f69c044edf4 (diff)
Permissions requesting fixes (#1334)
* Fix permissions requests not occurring during user interaction * Update toggle after changing permissions * Update functions * Update clipboard requests
Diffstat (limited to 'ext/bg/js/settings/anki-controller.js')
-rw-r--r--ext/bg/js/settings/anki-controller.js9
1 files changed, 1 insertions, 8 deletions
diff --git a/ext/bg/js/settings/anki-controller.js b/ext/bg/js/settings/anki-controller.js
index e7c8db15..26abebeb 100644
--- a/ext/bg/js/settings/anki-controller.js
+++ b/ext/bg/js/settings/anki-controller.js
@@ -339,14 +339,7 @@ class AnkiController {
}
async _requestClipboardReadPermission() {
- const permissions = ['clipboardRead'];
-
- if (await new Promise((resolve) => chrome.permissions.contains({permissions}, resolve))) {
- // Already has permission
- return;
- }
-
- return await new Promise((resolve) => chrome.permissions.request({permissions}, resolve));
+ return await this._settingsController.setPermissionsGranted(['clipboardRead'], true);
}
_getFieldMarkers(fieldValue) {