Port of XScreensaver's 'strange' hack to JavaScript