我正在查看一个包含内联 javascript 重定向(window.location = "/anotherpage"
)的页面。我想在 Chrome 中加载这个页面,但是禁用了重定向行,这样我就可以使用这个页面而不会被重定向。
以下是我试过的方法:
Developer tools -> Cog -> General -> Disable JavaScript. Load the page. It doesn't redirect (yay!). But I still want the rest of the page's javascript to run, and it hasn't.
Type the URL, then click Developer tools -> Sources -> Pause (F8) real fast! It hasn't redirected yet (yay!) Now I want to disable the redirect line before unpausing, but that part hasn't even loaded yet into Developer Tools. So I'll start stepping through the other files javascript code until I get there?? But as soon as I step out of the other files javascript, it immediately redirects away (doh!).
这可以做到吗? 我认为禁用一行 javascript 应该很容易,但我被难住了。