Reputation: 21202
I would like to switch from TWebBrowser to DCEF3 (TChromium).
Can DCEF3 edit a HTML page? If yes, how to enable it to enter 'editor' mode?
Upvotes: 0
Views: 616
Reputation: 3481
Since you can execute Javascript in Chromium, you can achieve anything that can be done in Javascript.
So you could use this:
procedure TMainForm.EditMode1Click(Sender: TObject);
begin
if crm.Browser <> nil then
crm.Browser.MainFrame.ExecuteJavaScript(
'document.designMode = "on"', 'about:blank', 0);
end;
procedure TMainForm.EditModeOFF1Click(Sender: TObject);
begin
if crm.Browser <> nil then
crm.Browser.MainFrame.ExecuteJavaScript(
'document.designMode = "off"', 'about:blank', 0);
end;
For more details, you should google how to use Javascript to make an (Simple) HTML Editor.
Upvotes: 1