When viewing page source in Google Chrome, the browser opens a new tab and basically pastes the URL in with the
view-source: prefix. This is undesirable.
As a developer, I may include some diagnostic output that is only visible in the source after submitting a form. When Chrome Refreshes the page to view the source, it makes this information disappear.
Is there anyway to prevent this behavior?
Note: I'm familiar with the "Inspect Element" option. This is just not an adequate stand-in for viewing the raw page source of the exact page you're looking at.
A quick test script
<pre> <?= print_r($_POST, true) ?> </pre> <form action="" method="post"> <input id="foo" name="foo" value="bar" /> <input type="submit" /> </form>
After clicking the submit button, the page shows
Array ( [foo] => bar )
If you view page source, you will see an empty
<pre> Array ( ) </pre> <form action="" method="post"> <input id="foo" name="foo" value="bar" /> <input type="submit" /> </form>
Apparently this bug has already been submitted. Sigh...
If anyone knows of a good work around, I'd greatly appreciate it.