summaryrefslogtreecommitdiff
path: root/src/ui/siteInfo.js
diff options
context:
space:
mode:
authorhackademix2018-07-01 01:01:23 +0200
committerhackademix2018-07-01 01:01:23 +0200
commiteceae7187a6f0e9510bc1165f6977256b87f490f (patch)
treed943f1ec73c09efa70954dcedb55eac82a726148 /src/ui/siteInfo.js
downloadnoscript-eceae7187a6f0e9510bc1165f6977256b87f490f.tar.gz
noscript-eceae7187a6f0e9510bc1165f6977256b87f490f.tar.xz
noscript-eceae7187a6f0e9510bc1165f6977256b87f490f.zip
Initial commit starting at version 10.1.8.3rc4.
Diffstat (limited to 'src/ui/siteInfo.js')
-rw-r--r--src/ui/siteInfo.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/ui/siteInfo.js b/src/ui/siteInfo.js
new file mode 100644
index 0000000..708c983
--- /dev/null
+++ b/src/ui/siteInfo.js
@@ -0,0 +1,20 @@
+(async () => {
+ let [domain, tabId] = decodeURIComponent(location.hash.replace("#", "")).split(";");
+ const BASE = "https://noscript.net";
+ await include(['/lib/punycode.js', '/common/Storage.js']);
+ let {siteInfoConsent} = await Storage.get("sync", "siteInfoConsent");
+ if (!siteInfoConsent) {
+ await include('/common/locale.js');
+ siteInfoConsent = confirm(_("siteInfo_confirm", [domain, BASE]));
+ if (siteInfoConsent) {
+ await Storage.set("sync", {siteInfoConsent});
+ } else {
+ let current = await browser.tabs.getCurrent();
+ await browser.tabs.update(parseInt(tabId), {active: true});
+ await browser.tabs.remove(current.id);
+ return;
+ }
+ }
+ let ace = punycode.toASCII(domain);
+ location.href = `${BASE}/about/${domain};${ace}`;
+})();