Firefox saves different page source from that actually viewed.

RESOLVED FIXED in mozilla10

Status

()

Toolkit
View Source
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: lothar_, Assigned: arno renevier)

Tracking

6 Branch
mozilla10
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Reporter)

Description

7 years ago
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; MathPlayer 2.20)

Steps to reproduce:

1. run Firefox.
2. open tab with uri: http://mises.org/articles.aspx?action=list
    wait for page contents to appear 
3. right click on text, select "view page source".
    note that the page source contents reflect the viewed page 
4. click toolbar "file", select "save page as", save in: Downloads, file name: mis1, "save"
5. within text of page, in the page choice list, click "2", 
    wait for page contents to appear 
    note that the contents are changed 
    nota bene: page choice list looks like: " < previous page 1 2 3 4 5 6 7 8 9 10 ...  of 66 next > "
6. right click on text, select "view page source".
    note that the page source contents reflect the viewed page 
7. click toolbar "file", select "save page as", save in: Downloads, file name: mis2, "save"
8. cd to saved file directory,
   using ls, wc and diff, show that saved files are the same.

Administrator@mobo /xp0/Documents and Settings/Administrator/My Documents/Downloads
$ ls -lt mis?.aspx
-rw-r--r--+ 1 Administrator None 140040 Sep  6 15:54 mis2.aspx
-rw-r--r--+ 1 Administrator None 140040 Sep  6 15:53 mis1.aspx

Administrator@mobo /xp0/Documents and Settings/Administrator/My Documents/Downloads
$ wc mis?.aspx
  1158   4659 140040 mis1.aspx
  1158   4659 140040 mis2.aspx
  2316   9318 280080 total

Administrator@mobo /xp0/Documents and Settings/Administrator/My Documents/Downloads
$ diff mis?.aspx



Actual results:

Firefox saved the same page source for different viewed pages.


Expected results:

Firefox should have saved the actual page source for each viewed page.

Comment 1

7 years ago
Do you use Save as in the Source view window or in the main Firefox menu?

Comment 2

7 years ago
I have now seen it, can confirm on FF6 Win XP. "Save as" from the View Source window has the problem. "Save page as" from the main FF menu saves correct source.
Status: UNCONFIRMED → NEW
Component: General → Networking: File
Ever confirmed: true
Product: Firefox → Core
QA Contact: general → networking.file
This has nothing to do with file networking, just with how the UI is invoking the "save" function (as you can tell by the fact that it works fine in the browser window!).
Component: Networking: File → View Source
Product: Core → Toolkit
QA Contact: networking.file → view.source

Comment 4

7 years ago
Ok, thanks.
(Assignee)

Comment 5

7 years ago
Created attachment 561664 [details] [diff] [review]
patch proposal

patch proposal:
pass cacheKey to the url saving procedure.
XXX: I don't if gPageLoader.currentDescriptor.QueryInterface(Ci.nsISHEntry).cacheKey;
can throw an error sometimes
Attachment #561664 - Flags: review?(neil)

Comment 6

7 years ago
(In reply to arno renevier from comment #5)
> XXX: I don't if
> gPageLoader.currentDescriptor.QueryInterface(Ci.nsISHEntry).cacheKey;
> can throw an error sometimes
Neither do I, but you should just pass the page loader itself and the web browser persist object will retrieve the cache key if it can. See the documentation for nsIWebBrowserPersist's saveURI method.

Comment 7

7 years ago
https://developer.mozilla.org/en/nsIWebBrowserPersist#saveURI%28%29

(no direct link to the cache key parameter available)
(Assignee)

Comment 8

7 years ago
Created attachment 564057 [details] [diff] [review]
patch v2: pass the page loader as an argument directly

thanks for feedback. Here is an updated patch passing page loader as an argument.
Attachment #561664 - Attachment is obsolete: true
Attachment #561664 - Flags: review?(neil)
Attachment #564057 - Flags: review?(neil)

Comment 9

7 years ago
Comment on attachment 564057 [details] [diff] [review]
patch v2: pass the page loader as an argument directly

> // Strips the |view-source:| for saveURL()
[I noticed a slight inaccuracy as you're now using internalSave instead.]

>+  internalSave(window.content.location.href.substring(12), null, null, null, null, null,
>+               "SaveLinkTitle", null, null, null, gPageLoader);
[The first line is a little too long for my liking. Some potential options:
 a) removing "window." would help a bit
 b) move a couple of "null,"s to the next line
 c) move the five "null,"s to their own line
]
Attachment #564057 - Flags: review?(neil) → review+
(Assignee)

Comment 10

7 years ago
Created attachment 565542 [details] [diff] [review]
reviewed patch with comments addressed
Attachment #564057 - Attachment is obsolete: true
(Assignee)

Updated

7 years ago
Keywords: checkin-needed

Updated

7 years ago
Assignee: nobody → arno
In my queue with a few other bits that are being sent to try first and then onto inbound :-)

https://tbpl.mozilla.org/?tree=Try&rev=c1528769b893
Status: NEW → ASSIGNED
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/6e5cf287ab1e
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.