I'm viewing a page that has an inline javascript redirect (window.location = "/anotherpage"
). I want to load the page in Chrome but have the redirect line disabled, so I can use the page without getting redirected away.
Here's what I've tried:
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!).
Can this be done? I thought it should be easy to disable a line of javascript, but I'm stumped.
In that case, the new page can use JavaScript to redirect our article to a phishing page asking for BleepingComputer credentials. To prevent this from happening, a rel="noopener" HTML link attribute was created that prevents a new tab from using JavaScript to redirect the page.
Open Chrome DevTools. Press Control+Shift+P or Command+Shift+P (Mac) to open the Command Menu. Start typing javascript , select Disable JavaScript, and then press Enter to run the command. JavaScript is now disabled.
It is quite simple to do a page redirect using JavaScript at client side. To redirect your site visitors to a new page, you just need to add a line in your head section as follows.
Developer Tools -> Sources -> Event Listener Breakpoints (on the right sidebar) -> Load -> check unload
This will make debugger break on unload event which is dispatched before navigation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With