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) {
|
if (this.clipboardMonitorEnable !== null) {
|
||||||
this.clipboardMonitorEnable.addEventListener('change', (e) => {
|
this.clipboardMonitorEnable.addEventListener('change', (e) => {
|
||||||
if (e.target.checked) {
|
if (e.target.checked) {
|
||||||
this.startClipboardMonitor();
|
chrome.permissions.request(
|
||||||
|
{permissions: ['clipboardRead']},
|
||||||
|
(granted) => {
|
||||||
|
if (granted) {
|
||||||
|
this.startClipboardMonitor();
|
||||||
|
} else {
|
||||||
|
e.target.checked = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
this.stopClipboardMonitor();
|
this.stopClipboardMonitor();
|
||||||
}
|
}
|
||||||
|
@ -41,10 +41,12 @@
|
|||||||
"permissions": [
|
"permissions": [
|
||||||
"<all_urls>",
|
"<all_urls>",
|
||||||
"storage",
|
"storage",
|
||||||
"clipboardRead",
|
|
||||||
"clipboardWrite",
|
"clipboardWrite",
|
||||||
"unlimitedStorage"
|
"unlimitedStorage"
|
||||||
],
|
],
|
||||||
|
"optional_permissions": [
|
||||||
|
"clipboardRead"
|
||||||
|
],
|
||||||
"commands": {
|
"commands": {
|
||||||
"toggle": {
|
"toggle": {
|
||||||
"suggested_key": {
|
"suggested_key": {
|
||||||
|
Loading…
Reference in New Issue
Block a user