Javascript Alert Text Cutoff

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Javascript Alert Text Cutoff

Postby tslate » Tue Sep 19, 2017 10:38 am

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
Attachments
cef_js_alert.png
cef_js_alert.png (50.59 KiB) Viewed 12538 times
tslate
Techie
 
Posts: 32
Joined: Wed Jul 19, 2017 12:47 pm

Re: Javascript Alert Text Cutoff

Postby Czarek » Tue Sep 19, 2017 11:20 am

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
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: Javascript Alert Text Cutoff

Postby magreenblatt » Tue Sep 19, 2017 1:08 pm

magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Javascript Alert Text Cutoff

Postby tslate » Wed Sep 20, 2017 7:05 am

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
tslate
Techie
 
Posts: 32
Joined: Wed Jul 19, 2017 12:47 pm

Re: Javascript Alert Text Cutoff

Postby magreenblatt » Wed Sep 20, 2017 10:08 am

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.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Javascript Alert Text Cutoff

Postby tslate » Wed Sep 20, 2017 10:29 am

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?
tslate
Techie
 
Posts: 32
Joined: Wed Jul 19, 2017 12:47 pm

Re: Javascript Alert Text Cutoff

Postby magreenblatt » Wed Sep 20, 2017 10:34 am

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).
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Javascript Alert Text Cutoff

Postby tslate » Wed Sep 20, 2017 10:35 am

Thanks!
tslate
Techie
 
Posts: 32
Joined: Wed Jul 19, 2017 12:47 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 25 guests