Page 1 of 1

Re: save file using javascript

Posted: Sun Jun 18, 2017 6:23 am
by salvadordf
Hi,

I can't check your js code but I would try to set a URL in the second ExecuteJavaScript parameter, for example about:blank.

Remember to call ExecuteJavaScript when the document is fully loaded and in case you want to save a few key strokes, you can also call Chromium1.ExecuteJavaScript directly.

Re: save file using javascript

Posted: Sun Jun 18, 2017 9:08 am
by salvadordf
The window.open command will open a new tab or window in the browser. If you don't add the code to create and manage the popup windows then CEF3 will create a new window for you and TChromium has some problems with that.

Try setting Result := True in the TChromium.OnBeforePopup event to cancel the popup creation.

Handling the popup windows is very complicated in Delphi because CEF3 triggers the OnBeforePopup event in the IO thread. The next CEF3 version will trigger this in event in the UI thread so maybe this will be easier but, for now, I would try any other method to save files from javascript.