Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: desktop-options.js

Issue 29693555: Issue 5813 - Check also window.doNotTrack to properly support Edge (Closed)
Patch Set: Created Feb. 9, 2018, 9:01 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 911
912 // General tab 912 // General tab
913 getDocLink("contribute", (link) => 913 getDocLink("contribute", (link) =>
914 { 914 {
915 E("contribute").href = link; 915 E("contribute").href = link;
916 }); 916 });
917 getDocLink("acceptable_ads_criteria", (link) => 917 getDocLink("acceptable_ads_criteria", (link) =>
918 { 918 {
919 setLinks("enable-acceptable-ads-description", link); 919 setLinks("enable-acceptable-ads-description", link);
920 }); 920 });
921 setElementText(E("tracking-warning-1"), "options_tracking_warning_1", 921 setElementText(E("tracking-warning-1"), "options_tracking_warning_1",
saroyanm 2018/02/13 18:57:23 Note: This changes are already pushed (https://hg.
922 [getMessage("common_feature_privacy_title"), 922 [getMessage("common_feature_privacy_title"),
923 getMessage("options_acceptableAds_ads_label")]); 923 getMessage("options_acceptableAds_ads_label")]);
924 setElementText(E("tracking-warning-3"), "options_tracking_warning_3", 924 setElementText(E("tracking-warning-3"), "options_tracking_warning_3",
925 [getMessage("options_acceptableAds_privacy_label")]); 925 [getMessage("options_acceptableAds_privacy_label")]);
926 926
927 getDocLink("privacy_friendly_ads", (link) => 927 getDocLink("privacy_friendly_ads", (link) =>
928 { 928 {
929 E("enable-acceptable-ads-privacy-description").href = link; 929 E("enable-acceptable-ads-privacy-description").href = link;
930 }); 930 });
931 getDocLink("adblock_plus_{browser}_dnt", url => 931 getDocLink("adblock_plus_{browser}_dnt", url =>
932 { 932 {
933 setLinks("dnt", url); 933 setLinks("dnt", url);
934 }); 934 });
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
1080 { 1080 {
1081 acceptableAds.setAttribute("aria-checked", true); 1081 acceptableAds.setAttribute("aria-checked", true);
1082 acceptableAdsPrivacy.setAttribute("aria-disabled", false); 1082 acceptableAdsPrivacy.setAttribute("aria-disabled", false);
1083 } 1083 }
1084 else if (acceptableAdsPrivacyUrl in subscriptionsMap) 1084 else if (acceptableAdsPrivacyUrl in subscriptionsMap)
1085 { 1085 {
1086 acceptableAds.setAttribute("aria-checked", true); 1086 acceptableAds.setAttribute("aria-checked", true);
1087 acceptableAdsPrivacy.setAttribute("aria-checked", true); 1087 acceptableAdsPrivacy.setAttribute("aria-checked", true);
1088 acceptableAdsPrivacy.setAttribute("aria-disabled", false); 1088 acceptableAdsPrivacy.setAttribute("aria-disabled", false);
1089 1089
1090 if (navigator.doNotTrack != 1) 1090 // Edge uses window instead of navigator.
1091 // Prefer navigator first since it's the standard.
1092 if ((navigator.doNotTrack || window.doNotTrack) != 1)
1091 acceptableAdsForm.classList.add("show-dnt-notification"); 1093 acceptableAdsForm.classList.add("show-dnt-notification");
1092 } 1094 }
1093 else 1095 else
1094 { 1096 {
1095 // Using aria-disabled in order to keep the focus 1097 // Using aria-disabled in order to keep the focus
1096 acceptableAdsPrivacy.setAttribute("aria-disabled", true); 1098 acceptableAdsPrivacy.setAttribute("aria-disabled", true);
1097 acceptableAdsPrivacy.setAttribute("tabindex", -1); 1099 acceptableAdsPrivacy.setAttribute("tabindex", -1);
1098 } 1100 }
1099 } 1101 }
1100 1102
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
1469 }); 1471 });
1470 browser.runtime.sendMessage({ 1472 browser.runtime.sendMessage({
1471 type: "subscriptions.listen", 1473 type: "subscriptions.listen",
1472 filter: ["added", "disabled", "homepage", "lastDownload", "removed", 1474 filter: ["added", "disabled", "homepage", "lastDownload", "removed",
1473 "title", "downloadStatus", "downloading"] 1475 "title", "downloadStatus", "downloading"]
1474 }); 1476 });
1475 1477
1476 window.addEventListener("DOMContentLoaded", onDOMLoaded, false); 1478 window.addEventListener("DOMContentLoaded", onDOMLoaded, false);
1477 window.addEventListener("hashchange", onHashChange, false); 1479 window.addEventListener("hashchange", onHashChange, false);
1478 } 1480 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld