Bug 787570 - Fix relative URLs in reader mode. r=lucasr
authorBrian Nicholson <bnicholson@mozilla.com>
Tue, 04 Sep 2012 10:50:03 -0700
changeset 107807 abba691cf4041873954272aebc758099a1dc7152
parent 107806 d034d1924fc7afb327eb2eaf83103b88e25afb4d
child 107808 e8d7da1bd0b5914fa735dd9199e1a6040102289e
push id2248
push userakeybl@mozilla.com
push dateMon, 08 Oct 2012 19:23:44 +0000
treeherdermozilla-aurora@118a3b748323 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslucasr
bugs787570
milestone18.0a1
Bug 787570 - Fix relative URLs in reader mode. r=lucasr
mobile/android/chrome/content/Readability.js
--- a/mobile/android/chrome/content/Readability.js
+++ b/mobile/android/chrome/content/Readability.js
@@ -114,19 +114,20 @@ Readability.prototype = {
         return uri;
 
       // Scheme-rooted relative URI.
       if (uri.substr(0, 2) == "//")
         return scheme + "://" + uri.substr(2);
 
       // Prepath-rooted relative URI.
       if (uri[0] == "/")
-        return prePath + "/" + uri;
+        return prePath + uri;
 
-      // Standard relative URI; add entire path.
+      // Standard relative URI; add entire path. pathBase already includes a
+      // trailing "/".
       return pathBase + uri;
     }
 
     function convertRelativeURIs(tagName, propName) {
       let elems = articleContent.getElementsByTagName(tagName);
       for (let i = elems.length; --i >= 0;) {
         let elem = elems[i];
         let relativeURI = elem.getAttribute(propName);