 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, | |
| 
juliandoucette
2018/05/01 11:21:56
Detail: `.android` is applied to the android page
 | |
| 5 .android:not(.ua-samsung) #install, | |
| 6 /* Hide other platforms on android page when using Android */ | |
| 7 .ua-andriod.android #other-platform, | |
| 
juliandoucette
2018/05/01 11:21:56
Detail: ua-* classes are injected by the server (w
 | |
| 8 /* Hide ABB banner on android page when using Samsung Browser */ | |
| 9 #content.ua-android.ua-samsung #abb-banner | |
| 
juliandoucette
2018/05/01 11:21:56
Detail: `.ua-android` is injected by the server. `
 | |
| 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 content = document.getElementById("content"); | |
| 23 | |
| 24 // Replicating server behaviour on the frontend for testing | |
| 25 if (bowser.android) | |
| 26 content.classList.add("ua-android"); | |
| 27 | |
| 28 if (bowser.samsungBrowser) | |
| 29 { | |
| 30 // Assign more specific user agent (ua-android is already present) | |
| 31 document | |
| 
juliandoucette
2018/05/01 11:21:56
Oops... I'll use the content variable above in the
 | |
| 32 .getElementById("content") | |
| 33 .classList.add("ua-samsung"); | |
| 34 | |
| 35 // change the Android install link to Samsung Browser | |
| 36 document | |
| 37 .getElementById("install-android") | |
| 38 .href = "https://play.google.com/store/apps/details?id=org.adblockplus .adblockplussbrowser"; | |
| 39 | |
| 40 // update the install button text in English *only* | |
| 41 if (locale == "en") | |
| 42 document | |
| 43 .getElementById("install-android") | |
| 44 .textContent = "Agree and Install for Samsung Internet"; | |
| 45 } | |
| 46 }); | |
| 47 </script> | |
| 48 </head> | |
| 49 | |
| 1 <? include index ?> | 50 <? include index ?> | 
| OLD | NEW |