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: Applying changes from code review Created Nov. 2, 2016, 10:08 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
« no previous file with comments | « 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
Felix Dahlke 2016/11/17 18:34:37 Don't we revert this to the original upstream vers
diegocarloslima 2016/11/21 14:37:41 Yes, this is a snippet taken from the upstream cod
Felix Dahlke 2016/12/12 09:57:22 Just realised this is not upstream code but rather
+ // get URLs from prefs
+ try {
+ let formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].getService(Ci.nsIURLFormatter);
+
+ let links = [
+ {id: "faqURL", pref: "app.faqURL"},
+ {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);
},
« no previous file with comments | « mobile/android/base/strings.xml.in ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld