Created
August 20, 2013 22:19
-
-
Save j3lte/6288086 to your computer and use it in GitHub Desktop.
Javascript. Mobile debug (android), three finger touch
This file contains hidden or 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
| if( ( /android/gi ).test( navigator.appVersion ) ) { | |
| console = { | |
| "_log" : [], | |
| "log" : function() { | |
| var arr = []; | |
| for ( var i = 0; i < arguments.length; i++ ) { | |
| arr.push( arguments[ i ] ); | |
| } | |
| this._log.push( arr.join( ", ") ); | |
| }, | |
| "trace" : function() { | |
| var stack; | |
| try { | |
| throw new Error(); | |
| } catch( ex ) { | |
| stack = ex.stack; | |
| } | |
| console.log( "console.trace()\n" + stack.split( "\n" ).slice( 2 ).join( " \n" ) ); | |
| }, | |
| "dir" : function( obj ) { | |
| console.log( "Content of " + obj ); | |
| for ( var key in obj ) { | |
| var value = typeof obj[ key ] === "function" ? "function" : obj[ key ]; | |
| console.log( " -\"" + key + "\" -> \"" + value + "\"" ); | |
| } | |
| }, | |
| "show" : function() { | |
| alert( this._log.join( "\n" ) ); | |
| this._log = []; | |
| } | |
| }; | |
| window.onerror = function( msg, url, line ) { | |
| console.log("ERROR: \"" + msg + "\" at \"" + "\", line " + line); | |
| } | |
| window.addEventListener( "touchstart", function( e ) { | |
| if( e.touches.length === 3 ) { | |
| console.show(); | |
| } | |
| } ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment