Thursday, November 03, 2011

QRApplets

*QRapplets*

I don't know why I didn't think of this sooner. Though to be honest, I don't know whether they will work - but I see no reason why they shouldn't. Here's the idea:

- QR codes are used, among other things, to encode URLs. Using a QR code reader, you photograph the image, and then are taken to the encoded URL.

- Web browsers typically take HTTP addresses as input URLs. But as power-users have long known, you can execute Javascript applets with URLs as well. Clicking on the URL javascript: alert(2+2); will pop up an alert box with the answer. Try it!

You can see where I'm going with this: encoded Javascript applets in QR codes, or, as I so name them, QRApplets.

Just to make life easy, here's a page of some commonly useful Javascript address bar applets.

Take the source of these applets, and enter them into the QR Code generator.

Pictured below is the Download PDF bookmarklet used to download web pages in PDF format. Again, I don't know whether it will work on your smart phone - but some should (or if not, smartphone web browsers should make them work).

Try it. See whether it works. Here's the 2+2 applet:



And here's the Download PDF QRApplet:

4 comments:

  1. Does not work on my phone. When I open the link, it says the page doesn't exist anymore...

    Is it suppose to work on any smartphone?

    ReplyDelete
  2. It should work. But there's no guyarantee it will work - it depends on whether your phone's prowser properly handles Javascript URIs.

    ReplyDelete
  3. Naturally, I noticed right away that it's pronounced "crapplets". I smiled.

    ReplyDelete
  4. Mine displayed the following as text in my smartphone browser:
    http://javascript: alert(2+2);

    Interesting idea, though.

    Jeff Ross

    ReplyDelete

Your comments will be moderated. Sorry, but it's not a nice world out there.