News for hackers. Stuff that matters.
Re:Firefox and IE's "View source" can be spoofed to show any... by HNatWORK on Thursday September 08, 2011 @02:30PM (#2975060)
I believe Chrome shows the original source because when you View Source, it requests the page again. This complicates debugging Ajax requests (and also Get and Post requests).

Firefox and IE show the "current" source, which is liable to be replaced as shown by dave1010uk.

Type the following into the Chrome Dev Tools console, then the Firebug console:

  testBool = true;
  document.write('');
  typeof testBool;
Chrome shows boolean, firefox shows undefined.
Re:Firefox and IE's "View source" can be spoofed to show any... by JoachimSchipper on Thursday September 08, 2011 @04:57PM (#2975635)
Note that re-downloading the source prevents this attack, but does not mean that the source you are looking at is what the page is actually running - just make the web server leave out the reference to evil.js the second time an IP address requests the page...
Re:Firefox and IE's "View source" can be spoofed to show any... by cmelbye on Thursday September 08, 2011 @04:10PM (#2975472)
I think that's correct about Chrome. If you want to see the "current" source, the Web Inspector is the way to go.
Re:Firefox and IE's "View source" can be spoofed to show any... by knotty66 on Thursday September 08, 2011 @08:48PM (#2976301)
I wondered if there is anything different about the second (view source) request that could be detected and a different response provided - but I don't think so after a quick look with WireShark.
Re:Firefox and IE's "View source" can be spoofed to show any... by sesqu on Friday September 09, 2011 @01:11AM (#2976922)
Well, you could set up a temporary client blacklist based on cookies or IP addresses.
Re:Firefox and IE's "View source" can be spoofed to show any... by nightpool on Friday September 09, 2011 @09:58AM (#2978091)
The Firefox plugin Web Developer let's you set an option (View source in tab) that makes it work like the Chrome view source.
Re:Firefox and IE's "View source" can be spoofed to show any... by Tsagadai on Friday September 09, 2011 @12:08AM (#2976747)
If you right click in Chrome for 'inspect element' you also get disappearing source code.