make clipboardRead an optional permission
This commit is contained in:
parent
7ee87265cd
commit
d3f51690f8
@ -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();
|
||||
}
|
||||
|
@ -41,10 +41,12 @@
|
||||
"permissions": [
|
||||
"<all_urls>",
|
||||
"storage",
|
||||
"clipboardRead",
|
||||
"clipboardWrite",
|
||||
"unlimitedStorage"
|
||||
],
|
||||
"optional_permissions": [
|
||||
"clipboardRead"
|
||||
],
|
||||
"commands": {
|
||||
"toggle": {
|
||||
"suggested_key": {
|
||||
|
Loading…
Reference in New Issue
Block a user