Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Design mode

Post Reply
thefunkyjoint
Posts: 460
Joined: Thu Aug 10, 2017 12:40 pm

Design mode

Post 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
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Design mode

Post 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
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Design mode

Post 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
thefunkyjoint
Posts: 460
Joined: Thu Aug 10, 2017 12:40 pm

Re: Design mode

Post by thefunkyjoint »

Thank you ! :)
Post Reply