OLD | NEW |
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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 displays[j].textContent = title; | 230 displays[j].textContent = title; |
231 } | 231 } |
232 | 232 |
233 element.setAttribute("aria-label", title); | 233 element.setAttribute("aria-label", title); |
234 if (this.details[i].searchable) | 234 if (this.details[i].searchable) |
235 element.setAttribute("data-search", title.toLowerCase()); | 235 element.setAttribute("data-search", title.toLowerCase()); |
236 let controls = element.querySelectorAll(".control[role='checkbox']"); | 236 let controls = element.querySelectorAll(".control[role='checkbox']"); |
237 for (let control of controls) | 237 for (let control of controls) |
238 { | 238 { |
239 control.setAttribute("aria-checked", item.disabled == false); | 239 control.setAttribute("aria-checked", item.disabled == false); |
240 if (isAcceptableAds(item.url) && this == collections.filterLists) | |
241 { | |
242 control.disabled = true; | |
243 } | |
244 } | 240 } |
245 if (additionalSubscriptions.includes(item.url)) | 241 if (additionalSubscriptions.includes(item.url)) |
246 { | 242 { |
247 element.classList.add("preconfigured"); | 243 element.classList.add("preconfigured"); |
248 let disablePreconfigures = | 244 let disablePreconfigures = |
249 element.querySelectorAll("[data-disable~='preconfigured']"); | 245 element.querySelectorAll("[data-disable~='preconfigured']"); |
250 for (let disablePreconfigure of disablePreconfigures) | 246 for (let disablePreconfigure of disablePreconfigures) |
251 disablePreconfigure.disabled = true; | 247 disablePreconfigure.disabled = true; |
252 } | 248 } |
253 | 249 |
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1072 | 1068 |
1073 function setAcceptableAds() | 1069 function setAcceptableAds() |
1074 { | 1070 { |
1075 let acceptableAdsForm = E("acceptable-ads"); | 1071 let acceptableAdsForm = E("acceptable-ads"); |
1076 let acceptableAds = E("acceptable-ads-allow"); | 1072 let acceptableAds = E("acceptable-ads-allow"); |
1077 let acceptableAdsPrivacy = E("acceptable-ads-privacy-allow"); | 1073 let acceptableAdsPrivacy = E("acceptable-ads-privacy-allow"); |
1078 acceptableAdsForm.classList.remove("show-dnt-notification"); | 1074 acceptableAdsForm.classList.remove("show-dnt-notification"); |
1079 acceptableAds.setAttribute("aria-checked", false); | 1075 acceptableAds.setAttribute("aria-checked", false); |
1080 acceptableAdsPrivacy.setAttribute("aria-checked", false); | 1076 acceptableAdsPrivacy.setAttribute("aria-checked", false); |
1081 acceptableAdsPrivacy.setAttribute("tabindex", 0); | 1077 acceptableAdsPrivacy.setAttribute("tabindex", 0); |
1082 if (acceptableAdsUrl in subscriptionsMap) | 1078 if (acceptableAdsUrl in subscriptionsMap && |
| 1079 !subscriptionsMap[acceptableAdsUrl].disabled) |
1083 { | 1080 { |
1084 acceptableAds.setAttribute("aria-checked", true); | 1081 acceptableAds.setAttribute("aria-checked", true); |
1085 acceptableAdsPrivacy.setAttribute("aria-disabled", false); | 1082 acceptableAdsPrivacy.setAttribute("aria-disabled", false); |
1086 } | 1083 } |
1087 else if (acceptableAdsPrivacyUrl in subscriptionsMap) | 1084 else if (acceptableAdsPrivacyUrl in subscriptionsMap && |
| 1085 !subscriptionsMap[acceptableAdsPrivacyUrl].disabled) |
1088 { | 1086 { |
1089 acceptableAds.setAttribute("aria-checked", true); | 1087 acceptableAds.setAttribute("aria-checked", true); |
1090 acceptableAdsPrivacy.setAttribute("aria-checked", true); | 1088 acceptableAdsPrivacy.setAttribute("aria-checked", true); |
1091 acceptableAdsPrivacy.setAttribute("aria-disabled", false); | 1089 acceptableAdsPrivacy.setAttribute("aria-disabled", false); |
1092 | 1090 |
1093 // Edge uses window instead of navigator. | 1091 // Edge uses window instead of navigator. |
1094 // Prefer navigator first since it's the standard. | 1092 // Prefer navigator first since it's the standard. |
1095 if ((navigator.doNotTrack || window.doNotTrack) != 1) | 1093 if ((navigator.doNotTrack || window.doNotTrack) != 1) |
1096 acceptableAdsForm.classList.add("show-dnt-notification"); | 1094 acceptableAdsForm.classList.add("show-dnt-notification"); |
1097 } | 1095 } |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1285 else | 1283 else |
1286 knownSubscription[property] = subscription[property]; | 1284 knownSubscription[property] = subscription[property]; |
1287 } | 1285 } |
1288 subscription = knownSubscription; | 1286 subscription = knownSubscription; |
1289 } | 1287 } |
1290 switch (action) | 1288 switch (action) |
1291 { | 1289 { |
1292 case "disabled": | 1290 case "disabled": |
1293 updateSubscription(subscription); | 1291 updateSubscription(subscription); |
1294 setPrivacyConflict(); | 1292 setPrivacyConflict(); |
| 1293 |
| 1294 if (isAcceptableAds(subscription.url)) |
| 1295 setAcceptableAds(); |
1295 break; | 1296 break; |
1296 case "downloading": | 1297 case "downloading": |
1297 case "downloadStatus": | 1298 case "downloadStatus": |
1298 case "homepage": | 1299 case "homepage": |
1299 case "lastDownload": | 1300 case "lastDownload": |
1300 case "title": | 1301 case "title": |
1301 updateSubscription(subscription); | 1302 updateSubscription(subscription); |
1302 break; | 1303 break; |
1303 case "added": | 1304 case "added": |
1304 let {url} = subscription; | 1305 let {url} = subscription; |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1497 "ui_warn_tracking"] | 1498 "ui_warn_tracking"] |
1498 }); | 1499 }); |
1499 port.postMessage({ | 1500 port.postMessage({ |
1500 type: "subscriptions.listen", | 1501 type: "subscriptions.listen", |
1501 filter: ["added", "disabled", "homepage", "lastDownload", "removed", | 1502 filter: ["added", "disabled", "homepage", "lastDownload", "removed", |
1502 "title", "downloadStatus", "downloading"] | 1503 "title", "downloadStatus", "downloading"] |
1503 }); | 1504 }); |
1504 | 1505 |
1505 window.addEventListener("DOMContentLoaded", onDOMLoaded, false); | 1506 window.addEventListener("DOMContentLoaded", onDOMLoaded, false); |
1506 window.addEventListener("hashchange", onHashChange, false); | 1507 window.addEventListener("hashchange", onHashChange, false); |
OLD | NEW |