Is it possible to disable, or even better, replace with a custom function, window.location?
window.location
This question is related: Disable a built-in function in jav
try this
var _window = { location: "myLocation" }; (function (window) { console.log(window.location); }(_window));