tweaked the JavaScript interface to Cocoa desktop app