Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: mobile/android/chrome/content/aboutAdblockBrowser.xhtml

Issue 29346916: Issue 3220 - FAQ and Privacy Policy links redirect to English site only (Closed)
Patch Set: Created June 22, 2016, 12:31 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« mobile/android/base/strings.xml.in ('K') | « mobile/android/base/strings.xml.in ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mobile/android/chrome/content/aboutAdblockBrowser.xhtml
===================================================================
--- a/mobile/android/chrome/content/aboutAdblockBrowser.xhtml
+++ b/mobile/android/chrome/content/aboutAdblockBrowser.xhtml
@@ -49,19 +49,19 @@
#endif
</p>
</div>
</div>
<ul id="aboutLinks">
<div class="top-border"></div>
- <li><a href="https://adblockplus.org/en/faq">&aboutPage.faq.label;</a></li>
- <li><a href="https://adblockplus.org/en/privacy">&aboutPage.privacyPolicy.label;</a></li>
- <li><a href="https://adblockplus.org/en/contributors">&aboutPage.credits.label;</a></li>
+ <li><a id="faqURL">&aboutPage.faq.label;</a></li>
+ <li><a id="privacyURL">&aboutPage.privacyPolicy.label;</a></li>
+ <li><a id="creditsURL">&aboutPage.credits.label;</a></li>
<div class="bottom-border"></div>
</ul>
<div id="aboutDetails">
<p>&logoTrademark;</p>
</div>
<script type="application/javascript;version=1.8"><![CDATA[
@@ -100,16 +100,34 @@
let distroField = document.getElementById("distributionAbout");
distroField.textContent = distroAbout;
distroField.hidden = false;
}
} catch (e) {
// Pref is unset
}
+ // Using formatted URLs. See https://issues.adblockplus.org/ticket/3220
+ // get URLs from prefs
+ try {
Felix Dahlke 2016/09/15 14:59:22 Something seems wrong here with the indentation.
diegocarloslima 2016/10/21 13:37:43 Acknowledged.
+ let formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].getService(Ci.nsIURLFormatter);
+
+ let links = [
+ {id: "faqURL", pref: "app.faqURL"},
Felix Dahlke 2016/09/15 14:59:22 Given that we copied this code from about.js, we c
diegocarloslima 2016/10/21 13:37:43 Acknowledged.
+ {id: "privacyURL", pref: "app.privacyURL"},
+ {id: "creditsURL", pref: "app.creditsURL"},
+ ];
+
+ links.forEach(function(link) {
+ let url = formatter.formatURLPref(link.pref);
+ let element = document.getElementById(link.id);
+ element.setAttribute("href", url);
+ });
+ } catch (ex) {}
+
#ifdef MOZ_UPDATER
let Updater = {
update: null,
init: function() {
Services.obs.addObserver(this, "Update:CheckResult", false);
},
« mobile/android/base/strings.xml.in ('K') | « mobile/android/base/strings.xml.in ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld