view-source doesn't show the source code of the page I'm viewing
Categories
(Core :: Networking: Cookies, defect, P2)
Tracking
()
People
(Reporter: ivan.wills, Unassigned)
References
Details
(Whiteboard: [necko-triaged])
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0
Steps to reproduce:
On an internal site we use one domain to show different test environments, this is controlled by a cookie, when I view source reloads the html with out sending any of the cookies with it (and the pages original source doesn't seem to be used) . So I just see the page that shows me the source for the selecting environment.
Actual results:
The source of the environment selecting page is shown (as the environment cookie isn't passed)
Expected results:
Either the original source should be shown (it's there in the network tab) or the page should be re-loaded with the same parameters as were originally used
Comment 1•4 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Networking: Cookies' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Comment 2•4 years ago
|
||
This sounds similar to bug 787304.
Does the work around in bug 787304 comment 2 fix the issue for you?
| Reporter | ||
Comment 3•4 years ago
|
||
As it turns out I already have the work around turned on for the sites that I see the issue with so the work around in bug 787304 comment 2 is already implemented and doesn't change anything cookies aren't being passed to view-source.
Updated•4 years ago
|
Comment 5•1 year ago
|
||
See also the webRequest event for WebExtensions, which is similarly unable to handle these. Might be related or closer to the root cause of these view-source requests unexpected bypassing various things such as cookies and WebExtension.
I see the same behavior for "Save page as", and believe it is caused by the same underlying problem. (And I'd rather not create yet another duplicate ticket for the same thing.)
In my case, I'm requesting a Jira search result XML/RSS feed so I can use it for other programmatic purposes, but it is gated behind a login. Opening it initially works, but using "Save page as" or "View page source" most of the time ends up in an error page (that basically tells me I'm not logged in).
Investigating with the F12 developer tools' network tab shows that the initial request sends the Cookie along, but the second one does not.
Randomly, the page does return something useful, but I couldn't figure out why. The workaround from comment 2 has no effect on "Save page as" as far as I can tell (at least I'm not sure, since I can't find any dedicated privacy settings for the page in Firefox 132 - I added an exception for both the cookies and tracking protection but neither did anything).
My current workaround is keeping the network tab open and using "Save response as", but more often than not I forget about this issue and have to do another pass after my saved file is empty apart from the returned session error.
Description
•