From ee8dd54481844862f8e9fc28e9aa8ab4e6739a82 Mon Sep 17 00:00:00 2001 From: gorhill Date: Tue, 2 Jun 2015 08:26:35 -0400 Subject: [PATCH] added ability to disable hyperlink auditing --- platform/chromium/vapi-background.js | 7 +++++++ platform/firefox/vapi-background.js | 4 ++++ src/_locales/en/messages.json | 4 ++++ src/css/settings.css | 16 +++++++++++++++- src/js/background.js | 1 + src/js/settings.js | 12 +++++++++--- src/settings.html | 6 ++++-- 7 files changed, 44 insertions(+), 6 deletions(-) diff --git a/platform/chromium/vapi-background.js b/platform/chromium/vapi-background.js index 16aa7d3b6..872443964 100644 --- a/platform/chromium/vapi-background.js +++ b/platform/chromium/vapi-background.js @@ -83,6 +83,13 @@ vAPI.browserSettings = { }); break; + case 'hyperlinkAuditing': + chrome.privacy.websites.hyperlinkAuditingEnabled.set({ + value: !!details[setting], + scope: 'regular' + }); + break; + default: break; } diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index 37344a38e..6d58fbe20 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -108,6 +108,10 @@ vAPI.browserSettings = { // noop until I find what to use in Firefox break; + case 'hyperlinkAuditing': + // noop until I find what to use in Firefox + break; + default: break; } diff --git a/src/_locales/en/messages.json b/src/_locales/en/messages.json index 522a15cd4..cd34f9529 100644 --- a/src/_locales/en/messages.json +++ b/src/_locales/en/messages.json @@ -175,6 +175,10 @@ "message":"Disable pre-fetching (to prevent any connection for blocked network requests)", "description":"English: " }, + "settingsHyperlinkAuditingDisabledPrompt":{ + "message":"Disable hyperlink auditing", + "description":"English: " + }, "settingsExperimentalPrompt":{ "message":"Enable experimental features (About<\/a>)", "description":"English: Enable experimental features" diff --git a/src/css/settings.css b/src/css/settings.css index 0496dbd22..48ba84a15 100644 --- a/src/css/settings.css +++ b/src/css/settings.css @@ -7,9 +7,23 @@ ul#userSettings { li { margin-top: 0.25em; } -ul#userSettings { +ul#userSettings, +ul#userSettings ul { list-style-type: none; } +ul#userSettings a.info { + color: #ccc; + } +ul#userSettings a.info:hover { + color: #444; + } +ul#userSettings .subgroup { + margin-top: 1em; + } +ul#userSettings .subgroup > span { + font-size: larger; + font-weight: bold; + } #localData > ul > li { margin-top: 1em; } diff --git a/src/js/background.js b/src/js/background.js index bd8329be7..2a6027e4e 100644 --- a/src/js/background.js +++ b/src/js/background.js @@ -62,6 +62,7 @@ return { experimentalEnabled: false, externalLists: defaultExternalLists, firewallPaneMinimized: true, + hyperlinkAuditingDisabled: true, parseAllABPHideFilters: true, prefetchingDisabled: true, requestLogMaxEntries: 1000, diff --git a/src/js/settings.js b/src/js/settings.js index 5a2914301..7f98b28d8 100644 --- a/src/js/settings.js +++ b/src/js/settings.js @@ -192,10 +192,16 @@ var onUserSettingsReceived = function(details) { changeUserSettings('prefetchingDisabled', this.checked); }); - uDom('#advanced-user-enabled') - .prop('checked', details.advancedUserEnabled === true) + uDom('#prefetching-disabled') + .prop('checked', details.prefetchingDisabled === true) .on('change', function(){ - changeUserSettings('advancedUserEnabled', this.checked); + changeUserSettings('prefetchingDisabled', this.checked); + }); + + uDom('#hyperlink-auditing-disabled') + .prop('checked', details.hyperlinkAuditingDisabled === true) + .on('change', function(){ + changeUserSettings('hyperlinkAuditingDisabled', this.checked); }); uDom('#experimental-enabled') diff --git a/src/settings.html b/src/settings.html index 644a66283..07f8ff961 100644 --- a/src/settings.html +++ b/src/settings.html @@ -16,8 +16,10 @@
  • - -
  • +