Skip to content

Instantly share code, notes, and snippets.

@craigiswayne
Last active June 25, 2018 10:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save craigiswayne/591db4c3e6b1da1fa7b58c3034c05727 to your computer and use it in GitHub Desktop.
Save craigiswayne/591db4c3e6b1da1fa7b58c3034c05727 to your computer and use it in GitHub Desktop.
Debugging the window.open function
/**
* Debugging window.open function
* Overwrites the origin window.open function so that you can see the call stack
* And debug variables
* @see https://www.w3schools.com/Jsref/met_win_open.asp
*/
window.open = function( URL, name, specs, replace ){
console.group("Debugging the window.open function");
console.log("URL : " + URL);
console.log("name : " + name);
console.log("specs : " + specs);
console.log("replace: " + replace);
console.groupEnd();
debugger;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment