Closed Bug 684908 Opened 13 years ago Closed 13 years ago

Firefox saves different page source from that actually viewed.

Categories

(Toolkit :: View Source, defect)

6 Branch
x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla10

People

(Reporter: lothar_, Assigned: arno)

Details

Attachments

(1 file, 2 obsolete files)

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.
Do you use Save as in the Source view window or in the main Firefox menu?
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
Ok, thanks.
Attached patch patch proposal (obsolete) — Splinter Review
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)
(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.
https://developer.mozilla.org/en/nsIWebBrowserPersist#saveURI%28%29

(no direct link to the cache key parameter available)
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 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+
Attachment #564057 - Attachment is obsolete: true
Keywords: checkin-needed
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
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: