UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36
Steps to reproduce the problem:
Enter in the console -
debug(document.location.replace);
setTimeout(
function ()
{
document.location.replace('');
}, 1000);
What is the expected behavior?
A breakpoint is hit.
What went wrong?
The code runs without breaking.
Did this work before? No
Chrome version: 54.0.2840.59 Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: Shockwave Flash 23.0 r0
Use case -
I have an issue where I click on a link and suddenly some code is apparently calling document.location.replace("foo") or something and the page redirects (maliciously). In order to find the calling code, I want to set a breakpoint on calling document.location.replace, which is a native web platform function, that is not writable (so I cannot override it with my own function using Object.defineProperty, or use a proxy).
(The code is apparently elusive and obfuscated somewhat, so it is not just a search and replace)
I also tried setting an event listener breakpoint on beforeunload, but it did not show any stack trace that shows the origin of the navigation.
Comment 1 by phistuck@chromium.org
, Oct 20 2016Status: Duplicate (was: Unconfirmed)