This is mostly just a set of instructions on how to get the Javascript Console that's already in the Opera browser to show up on your Panels. I have included some instructions for optional enhancements, though.
Why would you want to do this? For an ordinary user, no reason really. For a web site developer - I've found it extremely handy to have the console as a panel rather than a separate window. You might too.
There is a downloadable version below these instructions, if you don't like typing.
<input
style="position: fixed; top: 0; right: 0;" type="button"
onclick="reset()" value="Clear" />
immediately
before the <div id="messages"> </div>
.window.scrollTo( 0,
document.getElementsByTagName( 'html' )[ 0 ].offsetHeight -
window.innerHeight );
after
msg_div.appendChild( document.createElement( "HR" ) );
(near the bottom of the file, about six lines above the reset()
function).<input id="eval" style="position: fixed;
top: 0; left: 0;"/>
just before the clear button code, then
add the following to the init() function (it's near the top of
the file): document.getElementById( 'eval' ).addEventListener(
'keypress', function( e ) { if ( e.keyCode == 13 ) { opera.postError( eval(
this.value ) ); this.select(); return false; } }, false);
.function dump( o ) { var m = o + '\n\n'; for ( var p in o ) { m += p +
'=' + o[ p ] + '\n'; } return m; }
.var d = new Date(); emsg.appendChild( htmlify(
'[#' + i + '@' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds()
+ '] ' ) );
just above emsg.appendChild( htmlify( msg )
);
."PRE"
to "SPAN"
in
the line var emsg = document.createElement( "PRE"
);
.jsconsole.html (4708) - Version suitable for Opera 7.50, 7.60, 8.00 and later. Right-click on this and select "Save target as...", then navigate to your Opera program folder as described above and save over your existing file. You may want to make a backup of your original file first, just in case.
This file contains all the options listed above.
Just in case you haven't read the comments inside jsconsole.html, here is an extract:
/* JavaScript console. Facilities available to user scripts: opera.postError(msg,...) Use from your own scripts to print debug statements to the console window. Each 'msg' is printed as a separate message in the console. */