X
點擊此處開啟此網站的行動版。

技術支援討論區

#-links (citations on wikipedia) in reader view don't work properly.

已張貼

In Reader View, when clicking #-links, as in links that makes you jump to somewhere else on the page, firefox doesn't open the link properly.

For example, the citation https://en.wikipedia.org/wiki/Cley_Marshes#cite_note-NAE9-1 on https://en.wikipedia.org/wiki/Cley_Marshes becomes https://en.wikipedia.org/wiki/#cite_note-NAE9-1 and thus, clicking the link redirects me to https://en.wikipedia.org/wiki/Main_Page#cite_note-NAE9-1 instead of jumping down to the citation on the page, neither in reader view or normally.

I have the same problem on another site which uses #-links as footnotes. On http://www.baka-tsuki.org/project/index.php?title=Mushoku_Tensei:Web_Chapter_67 the footnote http://www.baka-tsuki.org/project/index.php?title=Mushoku_Tensei:Web_Chapter_67#cite_note-1 becomes http://www.baka-tsuki.org/project/#cite_note-1 and thus redirects to http://www.baka-tsuki.org/project/index.php?title=Main_Page#cite_note-1 instead of jumping down the page.

I suspect it has something to do with how #-links are coded, but I don't know.

Is this a bug, and is there anything I can do to fix this?

Any help would be greatly appreciated.

Thanks in advance.

In Reader View, when clicking #-links, as in links that makes you jump to somewhere else on the page, firefox doesn't open the link properly. For example, the citation https://en.wikipedia.org/wiki/Cley_Marshes#cite_note-NAE9-1 on https://en.wikipedia.org/wiki/Cley_Marshes becomes https://en.wikipedia.org/wiki/#cite_note-NAE9-1 and thus, clicking the link redirects me to https://en.wikipedia.org/wiki/Main_Page#cite_note-NAE9-1 instead of jumping down to the citation on the page, neither in reader view or normally. I have the same problem on another site which uses #-links as footnotes. On http://www.baka-tsuki.org/project/index.php?title=Mushoku_Tensei:Web_Chapter_67 the footnote http://www.baka-tsuki.org/project/index.php?title=Mushoku_Tensei:Web_Chapter_67#cite_note-1 becomes http://www.baka-tsuki.org/project/#cite_note-1 and thus redirects to http://www.baka-tsuki.org/project/index.php?title=Main_Page#cite_note-1 instead of jumping down the page. I suspect it has something to do with how #-links are coded, but I don't know. Is this a bug, and is there anything I can do to fix this? Any help would be greatly appreciated. Thanks in advance.

額外的系統細節

已安裝的外掛程式

  • Adobe PDF Plug-In For Firefox and Netscape 11.0.12
  • Google Update
  • NPRuntime Script Plug-in Library for Java(TM) Deploy
  • Next Generation Java Plug-in 10.67.2 for Mozilla browsers
  • The plugin allows you to have a better experience with Microsoft Lync
  • The plugin allows you to have a better experience with Microsoft SharePoint
  • Shockwave Flash 18.0 r0
  • 5.1.40416.0
  • Unity Player 4.3.7f1
  • VLC media player Web Plugin

應用程式

  • User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0

更多資訊

guigs 1072 個解決方法 11697 個答案

I have seen this before in bug, however I do not have an eta for when this will change.

Please add your vote to this bug. There might also be a duplicate bug, but I could not find it.

I have seen this before in bug, however I do not have an eta for when this will change. *[https://bugzilla.mozilla.org/show_bug.cgi?id=1173823 Bug 1173823] Please add your vote to this bug. There might also be a duplicate bug, but I could not find it. ** [https://bugzilla.mozilla.org/page.cgi?id=etiquette.html Bugzilla Etiquette] ** [https://bugzilla.mozilla.org/page.cgi?id=voting.html Voting]

由 guigs 於 修改

cor-el
  • Top 10 Contributor
  • Moderator
17696 個解決方法 160119 個答案

It looks that this version of processing a link isn't covered by the code.

So it uses pathBase + uri where uri is the relative link (href="#cite_note-NAE9-1")

207   _fixRelativeUris: function(articleContent) {
208     var scheme = this._uri.scheme;
209     var prePath = this._uri.prePath;
210     var pathBase = this._uri.pathBase;
211
212     function toAbsoluteURI(uri) {
213       // If this is already an absolute URI, return it.
214       if (/^[a-zA-Z][a-zA-Z0-9\+\-\.]*:/.test(uri))
215         return uri;
216 
217       // Scheme-rooted relative URI.
218       if (uri.substr(0, 2) == "//")
219         return scheme + "://" + uri.substr(2);
220 
221       // Prepath-rooted relative URI.
222       if (uri[0] == "/")
223         return prePath + uri;
224 
225       // Dotslash relative URI.
226       if (uri.indexOf("./") === 0)
227         return pathBase + uri.slice(2);
228 
229       // Standard relative URI; add entire path. pathBase already includes a
230       // trailing "/".
231       return pathBase + uri;
232     }
It looks that this version of processing a link isn't covered by the code. *http://mxr.mozilla.org/mozilla-release/source/toolkit/components/reader/Readability.js So it uses pathBase + uri where uri is the relative link (href="#cite_note-NAE9-1") <pre><nowiki>207 _fixRelativeUris: function(articleContent) { 208 var scheme = this._uri.scheme; 209 var prePath = this._uri.prePath; 210 var pathBase = this._uri.pathBase; 211 212 function toAbsoluteURI(uri) { 213 // If this is already an absolute URI, return it. 214 if (/^[a-zA-Z][a-zA-Z0-9\+\-\.]*:/.test(uri)) 215 return uri; 216 217 // Scheme-rooted relative URI. 218 if (uri.substr(0, 2) == "//") 219 return scheme + "://" + uri.substr(2); 220 221 // Prepath-rooted relative URI. 222 if (uri[0] == "/") 223 return prePath + uri; 224 225 // Dotslash relative URI. 226 if (uri.indexOf("./") === 0) 227 return pathBase + uri.slice(2); 228 229 // Standard relative URI; add entire path. pathBase already includes a 230 // trailing "/". 231 return pathBase + uri; 232 }</nowiki></pre>