Chomper Stomping
jQuery/JavaScript/CSS 3/HTML 5, Java/PHP/Python/ActionScript, Git, Chrome/Firefox Extensions, Wordpress/Game/iPhone App Development and other random techie tidbits I've collected



prototyping

December 14, 2009

JavaScript Console v0.0.1

More articles by »
Written by: Christopher McCulloh
Tags: , ,

jsConsoleSS

So I just made this little extension for Chrome.

There were some pretty convoluted to gymnastics I had to go through to get the console on the page and get it to execute the JS I wanted it to execute. Pretty much the only hook you have it an onClick (from what I can tell). They’ve got it locked down TIGHT.

This needs a LOT of experimentation done, but it looks like you can use it to define functions on the page through the console and call those functions. However, the functions do NOT persist. So, you can do:

function test(){
alert('test');
}
test();

and “execute js” and an alert will come up and say “test”.

But you can’t do:

function test(){
alert('test');
}

and “execute js” and then:

test();

and “execute js” and expect an alert to pop up.

I’m sure there are many sound reasons for this from a security standpoint, but it’s annoying as hell to try and program for. It would be great if I could fix this and I have a few ideas as to how I can do that…

The main reason I’m making this is basically as a prototype/POC for the Status-bar Calculator port from FF since I’m going to have to do some very similar things to get the Calculator to show up in the bottom right hand corner (like this does).

EDIT: After publishing the extension, it was pointed out to me that Chrome already *has* a JavaScript console if you hit Ctrl + Shift + J. However, that console only allows single line input, whereas this allows for as many lines as you want, making this just a *little* more functional. It would be awesome if I could find a way to hook this console into that console.

Checkout the project page.



About the Author

Christopher McCulloh
E-Commerce developer at Finish Line Co-Author of HTML, XHTML and CSS All-in-one Desk Reference for Dummies Graduated from IU with a Bachelors of Media Arts and Science and a Certificate in Applied Computer Science. Tech Editor for Building Facebook Applications for Dummies and Building Websites All-in-one for Dummies 2nd Edition. Creator and maintainer of the Status-bar Calculator Firefox Extension Three years professional experience in Java E-Commerce Development and four years professional experience with PHP for a combined total of seven years professional JavaScript/HTML/CSS experience




 
 

 
warning

OH SHNIKES, WE’VE BEEN HAXORED!!!

Yes. It finally happened. After… 6 years? on the web I finally got hacked. Two domains affected: http://cmcculloh.com http://hallelujahbutton.com (this also of course affected all sub-domains of cmcculloh.com, such as blo...
by Christopher McCulloh
1

 
 
octocat

Introducing GitScripts

GitScripts is a project that attempts to make Git user friendly. I have been working on it for almost a year now. When we implemented Git in my office, we were having a really hard time using it. We loved the flexibility of the...
by Christopher McCulloh
1

 
 
tabedit

Updates – Tab Edit 1.4, Abandoning JS Console, Limeberry news

It’s apparently Code Blitz week here at Chomperstomp.com HQ. We’ve seen 5 blog posts in the last week, and code commits to no less than 4 open source projects (plus tons behind the scenes that I won’t talk abo...
by Christopher McCulloh
0

 

 
 

Chrome Extension – Status-bar Calculator v0.1.9

So I ported the Status-bar Calculator over to Chrome. It took me a little under 2 hours. Chrome extensions are shaping up to be a gagillion times easier to create than FF extensions were back when I started doing them four year...
by Christopher McCulloh
0

 
 
 

Google Wave Invitations

So after my previous post with the rousing endorsement for wave (haha) it turns out I actually have 16 wave invitations I can send out. If anyone wants one, leave a comment with the e-mail you want me to send it to (if you don&...
by Christopher McCulloh
0

 




5 Comments



Leave a Reply

Your email address will not be published. Required fields are marked *

*


+ eight = 11

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>