News for hackers. Stuff that matters.
Re:Editmode: Make any website editable inline by chrismorgan on Thursday May 28, 2020 @06:11AM (#23335554)
From the description (“make any website editable inline”), I expected this to be a browser extension or similar that would allow you to change the content on any website. I find instead that it’s a CMS sort of thing, and is just a way of editing content on sites that you control and set it up on.

But in case anyone wants the other:

  document.designMode = 'on'
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.
Re:Editmode: Make any website editable inline by efa on Thursday May 28, 2020 @10:13AM (#23337465)
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!
Re:Editmode: Make any website editable inline by vldo on Thursday May 28, 2020 @09:40AM (#23337077)
i have a bookmark for it: javascript:(function () %7Bdocument.designMode%3D'on'%7D)()
Re:Editmode: Make any website editable inline by askz on Thursday May 28, 2020 @11:06AM (#23338171)
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"
Re:Editmode: Make any website editable inline by croon on Friday May 29, 2020 @09:21AM (#23349649)
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';})()

Re:Editmode: Make any website editable inline by cf on Thursday May 28, 2020 @03:24PM (#23341339)
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.