Hacker News new | ask | show | jobs
by askz 2218 days ago
I actually have this one :

javascript:(function () { document.designMode == 'on' ? document.designMode = 'off' : document.designMode = 'on';})()

1 comments

Just so you know, the immediately-invoked function expression (IIFE) syntax is unnecessary here. This would do:

  javascript:document.designMode=document.designMode=='on'?'off':'on'
Doesn't seem to work in chrome. Clicking it just sends you to a page that says "on"
This works for me in Chrome and Firefox, and is a bit shorter than the others (excluding your parent).

javascript:(function () {document.designMode=document.designMode=='on'?'off':'on';})()