Firefox的“查看源代码”可以吗?被设置为不发出新的GET请求? [英] Can Firefox's "view source" be set to not make a new GET request?
问题描述
- 如果您刚刚发布POST并执行查看源代码,您将看不到你的浏览器实际上是为你呈现的HTML。
- 如果网站作者错误地做了一个需要一些操作的表单(发送电子邮件或写入数据库或其他)再次被采取(或尝试)。这有点危险。
我听说有些东西可以添加到about:config中,运气。我还读了一些可以解决这个问题的扩展,Firebug首席执行官,但是与F12相比,ctrl-shift-u非常方便,然后点击几下鼠标就可以找到你感兴趣的元素。
那么...是否有一个开关,我可以翻转,使Firefox的查看源代码一直像查看生成的源代码,并打到缓存,而不是一个新的GET请求?
在地址栏中输入about:config。
过滤器框中键入:browser.cache
browser.cache.disk.enable和browser.cache.memory.enable必须设置为TRUE。
完成!所有功劳归于@MatrixFrog
This is sort of tangential to coding, but programmers often do "view source" on their own pages and on others' pages. I learned that when you do the normal View Source in Firefox, it takes the URL you're at and issues another GET request to that URL. There are two reasons why this is bad:
- If you've just issued a POST and do View Source, you won't see the HTML that your browser is actually rendering for you.
- If the site author has incorrectly made a form that takes some action (sends email or writes to a DB or whatever), then that action will be taken (or attempted, anyway) again. That's sort of dangerous.
I'd heard there was something I could add to about:config that would prevent this, but had no luck. I also read about some extensions that would get around this, Firebug chief among them, but ctrl-shift-u is so convenient when compared to F12 and then a couple of clicks to find the element you're interested in.
So... Is there a switch I can flip to make Firefox's View Source act like View Generated Source all the time and hit the cache instead of making a new GET request?
Type "about:config" in the address bar.
In the filter box, type : "browser.cache"
"browser.cache.disk.enable" and "browser.cache.memory.enable" must be set to TRUE.
Done ! All credit to @MatrixFrog
这篇关于Firefox的“查看源代码”可以吗?被设置为不发出新的GET请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!