diff options
author | siikamiika <siikamiika@users.noreply.github.com> | 2019-10-27 01:51:18 +0300 |
---|---|---|
committer | siikamiika <siikamiika@users.noreply.github.com> | 2019-10-27 01:51:18 +0300 |
commit | d3f51690f8bb236d1ba3c79c20b3a60d3e62dc52 (patch) | |
tree | a7e20dffa1fb1b5ce7ad4b1c28acf6810be16be3 /ext/bg/js/search.js | |
parent | 7ee87265cd937a8dd584c509d3c8ed45c96c221f (diff) |
make clipboardRead an optional permission
Diffstat (limited to 'ext/bg/js/search.js')
-rw-r--r-- | ext/bg/js/search.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js index 8484e042..a09ca822 100644 --- a/ext/bg/js/search.js +++ b/ext/bg/js/search.js @@ -85,7 +85,16 @@ class DisplaySearch extends Display { if (this.clipboardMonitorEnable !== null) { this.clipboardMonitorEnable.addEventListener('change', (e) => { if (e.target.checked) { - this.startClipboardMonitor(); + chrome.permissions.request( + {permissions: ['clipboardRead']}, + (granted) => { + if (granted) { + this.startClipboardMonitor(); + } else { + e.target.checked = false; + } + } + ); } else { this.stopClipboardMonitor(); } |