Skip to content

Instantly share code, notes, and snippets.

@wanderingstan
Created November 25, 2019 19:03
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 wanderingstan/b009619bd5f48d9572d441f673a87f8b to your computer and use it in GitHub Desktop.
Save wanderingstan/b009619bd5f48d9572d441f673a87f8b to your computer and use it in GitHub Desktop.
Playing with browser console
// Copy paste this into chrome/ff console
class StackOverflow_Answers {
get Open_javascript_console_without_blah_bah() {
window.open("https://google.com/")
return false;
}
get How_do_I_print_from_javascript_I_am_dumb() {
window.open("https://google.com/")
return false;
}
}
class Github_Issues {
get Example_of_doing_something_cool() {
window.open("https://google.com/")
return false;
}
get My_error_output() {
Object.assign(document.createElement('a'), { target: '_blank', href: 'http://wanderingstan.com'}).click();
return false;
}
}
window.onerror = function(msg, url, linenumber) {
console.error(
"%cError Central Insights\n",
"color: Green; font-weight: bold; font-family: Arial, Helvetica; font-size: small;",
new StackOverflow_Answers(),
new Github_Issues()
);
return true;
}
console.error(
"%cError Central Insights\n",
"color: Green; font-weight: bold; font-family: Arial, Helvetica; font-size: small;",
new StackOverflow_Answers(),
new Github_Issues()
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment