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