 Issue 29766571:
  Fixes #55 - Updated install button on Samsung Browser for Android  (Closed) 
  Base URL: https://hg.adblockplus.org/web.adblockplus.org
    
  
    Issue 29766571:
  Fixes #55 - Updated install button on Samsung Browser for Android  (Closed) 
  Base URL: https://hg.adblockplus.org/web.adblockplus.org| Left: | ||
| Right: | 
| 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, | |
| 
ire
2018/05/02 08:06:59
Typo in "ua-android"
 | |
| 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 | |
| 14 /* Show ABB notification under install button when using Samsung Browser */ | |
| 15 #content.ua-android.ua-samsung #adblock-browser-notification | |
| 16 { | |
| 17 display: block; | |
| 18 } | |
| 19 </style> | |
| 20 <script src="/js/vendor/bowser.js"></script> | |
| 21 <script> | |
| 22 document.addEventListener("DOMContentLoaded", function() | |
| 23 { | |
| 24 if (!bowser instanceof Object) return; | |
| 25 | |
| 26 var locale = "{{ locale }}"; | |
| 27 | |
| 28 var contentElement = document.getElementById("content"); | |
| 
ire
2018/05/02 08:06:59
Coding style -> "No hungarian notation"
 | |
| 29 | |
| 30 // Replicating server behaviour on the frontend for testing | |
| 31 if (bowser.android) | |
| 32 contentElement.classList.add("ua-android"); | |
| 33 | |
| 34 if (bowser.samsungBrowser) | |
| 35 { | |
| 36 // Assign more specific user agent (ua-android is already present) | |
| 37 contentElement.classList.add("ua-samsung"); | |
| 38 | |
| 39 // change the Android install link to Samsung Browser | |
| 40 document | |
| 41 .getElementById("install-android") | |
| 42 .href = "https://play.google.com/store/apps/details?id=org.adblockplus .adblockplussbrowser"; | |
| 43 | |
| 44 // update the install button text in English *only* | |
| 45 if (locale == "en") | |
| 46 document | |
| 47 .getElementById("install-android") | |
| 48 .textContent = "Agree and Install for Samsung Internet"; | |
| 49 } | |
| 50 }); | |
| 51 </script> | |
| 52 </head> | |
| 53 | |
| 1 <? include index ?> | 54 <? include index ?> | 
| OLD | NEW |