為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

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

  • 2 回覆
  • 1 有這個問題
  • 3 次檢視
  • 最近回覆由 cor-el

more options

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.

所有回覆 (2)

more options

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.

由 guigs 於 修改

more options

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     }