Wow! 20 years doing web development and I never knew about this.
Re:Editmode: Make any website editable inline
by hartator on Thursday May 28, 2020 @10:21AM
(#23337589)
Lol same here. I was surprised `document.designMode = 'on'` worked!
i have a bookmark for it: javascript:(function () %7Bdocument.designMode%3D'on'%7D)()
I actually have this one :
javascript:(function () { document.designMode == 'on' ? document.designMode = 'off' : document.designMode = 'on';})()
Re:Editmode: Make any website editable inline
by chrismorgan on Thursday May 28, 2020 @01:27PM
(#23339986)
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'
Re:Editmode: Make any website editable inline
by hyldmo on Thursday May 28, 2020 @03:42PM
(#23341640)
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';})()
Oh my god, I had the same thought and forgot how readily this features actually exists.
I suppose I still like the idea of persisting those changes for websites I control but that's going to be way less straightforward.
Re:Editmode: Make any website editable inline
by imshashank on Thursday May 28, 2020 @06:24AM
(#23335633)
As a kid, I used to love doing "document.designMode = 'on'"
Re:Editmode: Make any website editable inline
by XCSme on Thursday May 28, 2020 @11:49AM
(#23338688)
There were a lot of people showing how they "hack" a long time ago using a similar command `document.body.contentEditable = true`, changing their PayPal balance to $9999, thus getting free money!
Re:Editmode: Make any website editable inline
by Wowfunhappy on Thursday May 28, 2020 @10:44AM
(#23337887)
But then you can't do anything with the changes, right? Like Inspector, it's all lost when you reload the page.
Re:Editmode: Make any website editable inline
by ceejayoz on Thursday May 28, 2020 @12:06PM
(#23338902)
> But then you can't do anything with the changes, right?
You can screenshot it, and use it as "proof".
I've seen people get scammed in this fashion - "he showed me screenshot of his bank balance!"
Re:Editmode: Make any website editable inline
by amelius on Thursday May 28, 2020 @10:57AM
(#23338028)
You can still have JS running on the page, e.g. to periodically walk the DOM tree and save changes to disk.
Re:Editmode: Make any website editable inline
by Wowfunhappy on Thursday May 28, 2020 @11:11AM
(#23338254)
Huh, clever! I wonder if anyone has built that.
But in case anyone wants the other:
It’s pretty cool. Basically it makes the whole page a contenteditable. Many years ago browsers had more involved UI wrapped around design mode (which was also exposed in the menu), with a formatting toolbars and such.