Page 1 of 1

Javascript Alert Text Cutoff

PostPosted: Tue Sep 19, 2017 10:38 am
by tslate
I noticed this while displaying alerts occasionally.

Windows 7 - Tested on both windows classic and aero themes and the same cutoff.

The cutoff happens at ~182 characters.

Is this a Chromium issue?

Thanks

Re: Javascript Alert Text Cutoff

PostPosted: Tue Sep 19, 2017 11:20 am
by Czarek
You could implement a custom JS dialog using CefJSDialogHandler::OnJSDialog callback.

Regarding the bug, it seems to be CEF bug, default js dialog implementation for Windows is in "libcef/browser/native/javascript_dialog_runner_win.cc":
https://github.com/chromiumembedded/cef ... ner_win.cc

Re: Javascript Alert Text Cutoff

PostPosted: Tue Sep 19, 2017 1:08 pm
by magreenblatt

Re: Javascript Alert Text Cutoff

PostPosted: Wed Sep 20, 2017 7:05 am
by tslate
Hi,

Thank you both for the feedback. The product certainly is well structured and designed and easy to work with.

I'm converting a very large GECKO DOM based app I developed in 2009 into CEF so obviously this is curious to me. The thought is that CEF is using the V8 JS engine and since a large web app I tested otherwise renders okay, why a JS alert issue(I read the link on the bug). Is it just that simple that only the JS alert doesn't use the Chrome libraries or are there other issues regarding rendering. In other words I assume that the bulk of rendering is all Google Chromium interfaced with CEF. I'll be loading huge JS files from server and register from there. The app is all server-side rendering, etc.

I noted the Testing and Validation topic so I'll just go with that in terms of knowing that everything I'm doing must have been substantially validated by now.

Thanks

Re: Javascript Alert Text Cutoff

PostPosted: Wed Sep 20, 2017 10:08 am
by magreenblatt
The JS alert is implemented in native code (WinAPI, etc) in CEF. It is intentionally a minimal implementation with the expectation that clients will use CefJSDialogHandler if they need/want something fancy (e.g. clients may be using other frameworks or platforms that provide robust dialog implementations already). Use of the Chromium implementation as discussed in issue #2103 is a newer option that is now available to us due to architectural improvements over the last few years. The work has not been prioritized.

Re: Javascript Alert Text Cutoff

PostPosted: Wed Sep 20, 2017 10:29 am
by tslate
Is the bulk of rendering all Google Chromium interfaced with CEF, ie custom JS alert is rare? UI library aside, what is doing the actual rendering of the web page, I'm assuming that's all Google Chromium, is that correct?

Re: Javascript Alert Text Cutoff

PostPosted: Wed Sep 20, 2017 10:34 am
by magreenblatt
tslate wrote:Is the bulk of rendering all Google Chromium interfaced with CEF, ie custom JS alert is rare? UI library aside, what is doing the actual rendering of the web page, I'm assuming that's all Google Chromium, is that correct?

Rendering is implemented by Blink/Chromium. Dialogs are a special case and must be implemented by CEF or the client. The same applies to the color picker dialog (see https://bitbucket.org/chromiumembedded/cef/issues/899).

Re: Javascript Alert Text Cutoff

PostPosted: Wed Sep 20, 2017 10:35 am
by tslate
Thanks!