Page 1 of 1

Design mode

Posted: Sun Apr 29, 2018 11:42 am
by thefunkyjoint
Hi,

The old (and buggy) TWebbrowser had a mode where you could edit the page in WYSIWYG mode, adding and formatting text, and it would generate the respective html code in source. To achieve this you would run this command :

(webbrowser1.Document as IHTMLDocument2).designMode := 'On';

Is there any way to do something similar in TChromium ?

Thanks

Re: Design mode

Posted: Sun Apr 29, 2018 1:02 pm
by salvadordf
The official CEF forum seems to be down at this moment but the other information sources say that you can create editable regions to change their contents.

Set the HTML5 attribute contenteditable to true like this :

Code: Select all

<p contenteditable="true">This is an editable paragraph.</p>
Examples :
https://www.w3schools.com/tags/tryit.as ... nteditable
https://developer.mozilla.org/en-US/doc ... le_content
https://codepen.io/matt-west/full/gtruC

Re: Design mode

Posted: Sun Apr 29, 2018 1:11 pm
by salvadordf
Enabling "document.designMode" also works in CEF.
https://developer.mozilla.org/en-US/doc ... designMode

Visit this page and click the "SHOW EMBED" button. Then click on the "Run Pen" button :
https://hackernoon.com/easily-create-an ... d1c465d39b

Re: Design mode

Posted: Fri May 04, 2018 4:43 pm
by thefunkyjoint
Thank you ! :)