DEV Community

Cover image for Edit Your Website Live In Google Chrome by using document.designMode
Arbaoui Mehdi
Arbaoui Mehdi

Posted on

Edit Your Website Live In Google Chrome by using document.designMode

I was on my twitter, reading stuff, then suddenly I see a tweet which shows a cool feature that I never thought exist, this feature is document.designMode which allows you editing the entire document directly, this property is set by default to off, let's change it to on and see the MAGIC HAPPENS.

Google Chrome document.designMode

document.designMode="on"
Enter fullscreen mode Exit fullscreen mode

Credit:

Discussion (9)

Collapse
andrebclark profile image
Andre • Edited on

I was expecting something like visbug. this feature feels more like a content editing mode than a 'design' mode. is there anything more you can do to this besides change text? what is the use case where this is actually helpful? I don't mean to be a contrarian, but what am I missing?

Collapse
arbaoui_mehdi profile image
Arbaoui Mehdi Author

Sometimes long words can break the design, so document.designMode can be used to tweak the design in the Browser. This is an interesting article that go through some use cases of this feature:

css-tricks.com/using-devtools-twea...

Collapse
raymag profile image
Carlos Magno

Dude, I'm so grateful for you sharing this awesome feature!

Collapse
arbaoui_mehdi profile image
Arbaoui Mehdi Author

Same here, I really found this property super useful.

Collapse
sulco profile image
Tomek Sułkowski

Hey, glad you've liked it so much to spread the word 💪

And I appreciate crediting me :)

Collapse
arbaoui_mehdi profile image
Arbaoui Mehdi Author

I really was amazed when I see your tweet, so all the credit is for you for sharing that with us. Thanks.

Collapse
saurabhdaware profile image
Saurabh Daware 🌻

whaaaaattt :o

Collapse
iamarsenibragimov profile image
Arsen Ibragimov

Wow! Didn't even no about it!

Collapse
ggarnier profile image
Guilherme Garnier

BTW, this is not just for Chrome. It works basically with any browser, including IE6!

caniuse.com/mdn-api_document_desig...