Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 <head> | 1 <head> |
2 <style> | 2 <style> |
3 /* Hide TOS & Install on android page when not using Samsung Browser */ | 3 /* Hide TOS & Install on android page when not using Samsung Browser */ |
4 .android:not(.ua-samsung) #terms-message, | 4 .android:not(.ua-samsung) #terms-message, |
5 .android:not(.ua-samsung) #install, | 5 .android:not(.ua-samsung) #install, |
6 /* Hide other platforms on android page when using Android */ | 6 /* Hide other platforms on android page when using Android */ |
7 .ua-andriod.android #other-platform, | 7 .ua-andriod.android #other-platform, |
ire
2018/05/02 08:06:59
Typo in "ua-android"
| |
8 /* Hide ABB banner on android page when using Samsung Browser */ | 8 /* Hide ABB banner on android page when using Samsung Browser */ |
9 #content.ua-android.ua-samsung #abb-banner | 9 #content.ua-android.ua-samsung #abb-banner |
10 { | 10 { |
11 display: none; | 11 display: none; |
12 } | |
13 | |
14 /* Show ABB notification under install button when using Samsung Browser */ | |
15 #content.ua-android.ua-samsung #adblock-browser-notification | |
16 { | |
17 display: block; | |
12 } | 18 } |
13 </style> | 19 </style> |
14 <script src="/js/vendor/bowser.js"></script> | 20 <script src="/js/vendor/bowser.js"></script> |
15 <script> | 21 <script> |
16 document.addEventListener("DOMContentLoaded", function() | 22 document.addEventListener("DOMContentLoaded", function() |
17 { | 23 { |
18 if (!bowser instanceof Object) return; | 24 if (!bowser instanceof Object) return; |
19 | 25 |
20 var locale = "{{ locale }}"; | 26 var locale = "{{ locale }}"; |
21 | 27 |
22 var contentElement = document.getElementById("content"); | 28 var contentElement = document.getElementById("content"); |
ire
2018/05/02 08:06:59
Coding style -> "No hungarian notation"
| |
23 | 29 |
24 // Replicating server behaviour on the frontend for testing | 30 // Replicating server behaviour on the frontend for testing |
25 if (bowser.android) | 31 if (bowser.android) |
26 contentElement.classList.add("ua-android"); | 32 contentElement.classList.add("ua-android"); |
27 | 33 |
28 if (bowser.samsungBrowser) | 34 if (bowser.samsungBrowser) |
29 { | 35 { |
30 // Assign more specific user agent (ua-android is already present) | 36 // Assign more specific user agent (ua-android is already present) |
31 contentElement.classList.add("ua-samsung"); | 37 contentElement.classList.add("ua-samsung"); |
32 | 38 |
33 // change the Android install link to Samsung Browser | 39 // change the Android install link to Samsung Browser |
34 document | 40 document |
35 .getElementById("install-android") | 41 .getElementById("install-android") |
36 .href = "https://play.google.com/store/apps/details?id=org.adblockplus .adblockplussbrowser"; | 42 .href = "https://play.google.com/store/apps/details?id=org.adblockplus .adblockplussbrowser"; |
37 | 43 |
38 // update the install button text in English *only* | 44 // update the install button text in English *only* |
39 if (locale == "en") | 45 if (locale == "en") |
40 document | 46 document |
41 .getElementById("install-android") | 47 .getElementById("install-android") |
42 .textContent = "Agree and Install for Samsung Internet"; | 48 .textContent = "Agree and Install for Samsung Internet"; |
43 } | 49 } |
44 }); | 50 }); |
45 </script> | 51 </script> |
46 </head> | 52 </head> |
47 | 53 |
48 <? include index ?> | 54 <? include index ?> |
LEFT | RIGHT |