Sandboxing Rhino in Java

Friday, January 2nd, 2009

I've been working on a Java app which needed Rhino for scripting. The app would need to run untrusted JavaScript code from 3rd parties, so I had to find a way to block access to all Java methods, except the ones I wanted. This would not be a problem if ...

JavaScript margin/block commenting system

Saturday, December 20th, 2008

On Djangobook, they used to have this interesting commenting mechanism on their book's pages: Each paragraph in the book could have comments, by use of a JavaScript commenting system which would display the amount of comments on each paragraph when you hovered over them with the mouse. You could also click ...

Common widget design patterns

Wednesday, December 3rd, 2008

I've worked on quite many widget projects, and very often they have certain patterns that keep appearing. I'm calling these "widget design patterns" - let's take a look at a few.

Generating Sudoku puzzles using JavaScript

Saturday, November 29th, 2008

While I'm not the biggest fan of Sudoku puzzles, I wanted to make a sudoku widget for the Opera x-widgets challenge. This required me to study the algorithms used for generating sudokus, which was actually a quite interesting challenge. While there are some examples of generating sudokus online, such as this ...

How to get your saved passwords from almost any browser

Tuesday, November 25th, 2008

Someone on ##opera in freenode was asking how to recover their saved password from Wand, Opera's password manager. While there is apparently no "official" way of getting to them, I thought that maybe you could simply hook into the form, and read the password when it's being submitted by Wand! Easy enough, ...

Creating a Dojo dijit.Tree with checkboxes

Friday, November 21st, 2008

Dojo provides a useful component called dijit.Tree, which is basically a quite typical tree component. However, it doesn't do much out of the box, and I needed it to make some tree nodes selectable with checkboxes for my Zend Framework based packageizer script. While Zend Framework has a Zend_Dojo component, ...

Dojo Toolkit – difficult to learn, is it worth it?

Wednesday, November 12th, 2008

I've usually dismissed the Dojo Toolkit as a difficult, poorly documented JavaScript library. However, Zend Framework recently decided to choose it as the default JS library to bundle with the framework. It can't be all bad if that happens, right? This sparked my curiosity towards Dojo again - Maybe it was time ...

Browser as an OS

Tuesday, November 4th, 2008

It seems as if the browser is becoming easier to understand than other applications for people who don't know much about computers in general. For example, if an application has a settings dialog and you ask the user to go back or close the dialog, they aren't always sure what ...

How to make back, forward and reload work in Ajax-based apps

Wednesday, July 16th, 2008

With Ajax apps getting more and more popular, there's often the question of the browsers own controls working or not in the app in question. If you hit reload, you might end up back on the start page of the application, if you hit back.. who knows. I think this is ...

JavaScript Canvas charting/timeline example

Monday, June 30th, 2008

I was on holiday last week and haven't been really able to think of anything really really interesting to write, so here's something I made a while back: A Canvas-element powered chart/graph/timeline thing of my programming language skills, which I made as an excercise for making chart-type stuff with canvas. I ...