Created
November 25, 2019 19:03
-
-
Save wanderingstan/b009619bd5f48d9572d441f673a87f8b to your computer and use it in GitHub Desktop.
Playing with browser console
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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