Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I like Firefox's behaviour of loading the source from the currently loaded webpage. Chrome, instead, starts a new request. This makes it especially hard to view source of POST-requests, for example, since every view-source request utilizes GET.

Is there a way to change the way Google Chrome's view-source works, so that it does not initialize a new request?

EDIT, little bit of clarification regarding the way Firefox works:

Firefox does not initiate a new request when viewing the source. It does only after refreshing the page while viewing the source. It then respects the GET/POST of the request as well. When viewing the source of a page that is already loaded, it does not seem to initiate a new request.

share|improve this question
    
are you just interested in the current POST submit? use the developer tools and not the source-view. –  akira Feb 10 '11 at 9:44
    
Thanks for the tip; in this case I am looking for the state of the HTML source code after the POST request. It is not something that is completely hindering me from working, but it would be nice to have the ability to customize this behaviour. –  Aron Rotteveel Feb 10 '11 at 9:46
    
@Arjan it does only after refreshing the page while viewing the source. It then respects the GET/POST of the request as well. When viewing the source of a page that is already loaded, it does not seem to initialize a new request. –  Aron Rotteveel Feb 10 '11 at 9:51

2 Answers 2

up vote 8 down vote accepted

Is there a way to change the way Google Chrome's view-source works, so that it does not initialize a new request?

No, this is the way Chrome works by design.

When you "view source", you're really opening a new tab that opens the page again and displays the source rather than renders the page. Many web pages are dynamic and modify their HTML content (eg. using JavaScript/XMLHttpRequest) so we cannot display the current HTML - this is why a new request is made.

If you want to view the current state of a dynamic page, you should use the inspector. "File icon -> Developer -> JavaScript console"

I don't see how this is a security bug or a bug at all - the behavior is by design - closing as such.

share|improve this answer
    
Maybe things are different on a Mac, or have meanwhile changed. The when you "view source", you're really opening a new tab that opens the page again and displays the source rather than renders the page is NOT true on my Mac, neither for GET, nor for POST. (Yes, I did fire up Wireshark to make sure. No additional requests after hitting Option-Command-U.) –  Arjan Feb 10 '11 at 12:47
    
...but when doing a View Source after a POST, I do indeed see the source of the (earlier) GET...?! –  Arjan Feb 10 '11 at 12:51
2  
Try to teach a CSS class using Chrome and I think you'll agree it's more than a bug - it's a feature designed to make CSS development impossible. It is completely useless to see the source code of some OTHER page that you aren't looking at. A re-load is another page, not the one you wanted the source from. GOOGLE needs to know this is stupid - comment not directed at poster. –  Jasmine Jun 7 '13 at 21:41
    
@Arjan, Because it is cached. Remove your cache or disallow caching and you will see that view-source indeed issues a new request. –  Pacerier yesterday

I don't think you can change the behavior of view-source: URLs, or the View page source command, you can get to the source as received for this page: first, open the Developer tools (WebKit's "Web Inspector"), found at Wrench > Tools > Developer tools. Now click on Resources and (if necessary) scroll down the list on the left until you find the resource of interest. And there you go: the source as it was transmitted in the original HTTP response.

share|improve this answer
2  
No that reloads the source too. Fiddler can capture it. –  Jasmine Jun 7 '13 at 21:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.