搜尋 Mozilla 技術支援網站

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

Learn More

Some local links on web pages have been changed to fixed references on a saved page

  • 4 回覆
  • 2 有這個問題
  • 1 次檢視
  • 最近回覆由 ptoye

more options

I saved a page http://www.lilypond.org/doc/v2.18/Documentation/notation/index.html to my hard disk. The links in the table of contents on the left are all to the original website. I've looked at the file on disk and this is the case. An example is <a name="toc-Spacing-issues-1" href="http://www.lilypond.org/doc/v2.18/Documentation/notation-big-page#spacing-issues">4. Spacing issues</a>


But the original file had local links at the same place (a website expert there tells me), <a name="toc-Spacing-issues-1" href="notation-big-page#spacing-issues">4. Spacing issues</a>

Not all of the links are changed: some of them in the main text are still local links. Which I find even odder.

Why (and how) is Firefox changing the HTML text?

I saved a page http://www.lilypond.org/doc/v2.18/Documentation/notation/index.html to my hard disk. The links in the table of contents on the left are all to the original website. I've looked at the file on disk and this is the case. An example is <a name="toc-Spacing-issues-1" href="http://www.lilypond.org/doc/v2.18/Documentation/notation-big-page#spacing-issues">4. Spacing issues</a> But the original file had local links at the same place (a website expert there tells me), <a name="toc-Spacing-issues-1" href="notation-big-page#spacing-issues">4. Spacing issues</a> Not all of the links are changed: some of them in the main text are still local links. Which I find even odder. Why (and how) is Firefox changing the HTML text?

被選擇的解決方法

Thanks Finitarry - but the links are being changed to point to the original server, not my downloaded copy. That's the problem!

Also thank cor-el. I use "web page, complete" for the download.

I think I've found the problem, now that you've pointed out where I should be looking. I've found the original HTML, and in most cases the references are strictly local. But in the problem cases, the link contains the file name, which Firefox interprets as a request to point to the original file on the server rather than the local copy. Whether this is a bug or a feature would make an interesting discussion. I'll ask the web manager is that's what they meant to happen. I'll try another browser to see what happens there.

從原來的回覆中察看解決方案 👍 0

所有回覆 (4)

more options

All the links in a saved page should point to the files saved with the page. If some are not changed, that would be odd.

more options

If there are links to pages other that the one you currently view then those links will be changed to files on the server and not local files if you use "Web page, complete" to save the page.
You would have to use other means to download web pages if you do not want Firefox to modify the page content.


more options

選擇的解決方法

Thanks Finitarry - but the links are being changed to point to the original server, not my downloaded copy. That's the problem!

Also thank cor-el. I use "web page, complete" for the download.

I think I've found the problem, now that you've pointed out where I should be looking. I've found the original HTML, and in most cases the references are strictly local. But in the problem cases, the link contains the file name, which Firefox interprets as a request to point to the original file on the server rather than the local copy. Whether this is a bug or a feature would make an interesting discussion. I'll ask the web manager is that's what they meant to happen. I'll try another browser to see what happens there.

more options

To continue....

I realised that the links which are translated to server link are those which have the filename included, even when it's the same file name as the one being browsed. So file#anchor is saved as www.site.file#anchor, while #anchor is saved as #anchor.

I've found that neither IE nor Opera save the files at all, and all links are saved as www.site.file#anchor, even if they start out as #anchor, so Firefox is actually doing the right thing here.

Would it be a good idea if when saving FF were to look at the file name on links and if it's the same as the current page, save it as a local reference? I can think of arguments either way.