From f80cdf1f515d3932cce5a2641a789de8a53bd9a5 Mon Sep 17 00:00:00 2001 From: zmilonas Date: Mon, 23 Jul 2018 01:21:53 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=89=20Add=20advanced=20setting=20to=20?= =?UTF-8?q?allow=20all=20website=20access=20permission.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AdvancedSettings.vue | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/components/AdvancedSettings.vue b/src/components/AdvancedSettings.vue index 40bf6f7d..6b253438 100644 --- a/src/components/AdvancedSettings.vue +++ b/src/components/AdvancedSettings.vue @@ -30,6 +30,21 @@ +
+

Grant permission on all websites

+

Only proceed if you know what you're doing. If enabled, the extension prompts once for permission to access and change data on all websites and never again. This is irreversible and has serious security implications

+
+
+
+
+ +
+
+
+

Stored Data

The following objects represent the current data cached in local storage. This data is only available to Tusk, and is never sent over any network connection.

@@ -57,6 +72,13 @@ busy: false, expireTime: 2, hotkeyNavEnabled: false, + grantAllPermissions: false, + perms: { + origins: [ + "https://*/*", + "http://*/*" + ] + }, jsonState: [{ k: 'databaseUsages', // key f: this.settings.getSetDatabaseUsages, // getter @@ -124,6 +146,12 @@ }, hotkeyNavEnabled(newval, oldval) { this.settings.getSetHotkeyNavEnabled(newval) + }, + grantAllPermissions() { + chrome.runtime.sendMessage({ + m: "requestPermission", + perms: this.perms + }); } }, mounted() { @@ -133,6 +161,9 @@ this.settings.getSetHotkeyNavEnabled().then(val => { this.hotkeyNavEnabled = val; }) + chrome.permissions.contains(this.perms, granted => { + this.grantAllPermissions = !!granted; + }); this.jsonState.forEach(blob => { blob.f().then(result => { if (result && Object.keys(result).length) {