You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Upstream CEF 51 is now using X11 library for window management. Previously it used GTK. Now with X11 under the hood there are no default implementations for dialogs in libcef on Linux and that includes: print dialog, js dialogs, file dialog. However the cefclient sample application provides implementations for these dialogs using the GTK library. But it needs to be copied with a few minor modifications. Print dialog was already implemented in Issue #238 by copying print_handler_gtk.cc / print_handler_gtk.h files almost entirely.
To implement js/file dialogs copy these two files from upstream cefclient:
Also copy some code from cefclient's client_handler.h/client_handler.cc and add it somewhere in cefpython's src/client_handler/client_handler.cpp/h files:
This will require a bit more of modifications than it was required when copying Print dialog. That's because we already expose JSDialogHandler callbacks to python:
So the code needs to be modified to take into account that if there is a JavascriptDialogHandler callback provided in Python then use it, otherwise use the default implementation copied from cefclient. This might require modifying the javascript_dialog_handler.pyx file.
The text was updated successfully, but these errors were encountered:
…...
In wxpython.py and gtk2.py examples the js alert dialog when run
from a popup gives focus to the main window. The popup window is
created internally by CEF and this probably needs to be changed
so that popups are created by wx in OnBeforePopup and this will
resolve issue with alert focus. In qt4.py and tkinter.py and
hello_world.py examples focus works fine in the popup window.
Add --hello-world flag to build.py and run_examples.py tools.
Default js and file dialogs implementation added in commit c5951b6. If you return True in OnJavascriptDialog / OnBeforeUnloadJavascriptDialog callbacks then the default implementation will not be run.
In wxpython.py and gtk2.py examples the js alert dialog when run from a popup gives focus to the main window. The popup window is created internally by CEF and this probably needs to be changed so that popups are created by wx in OnBeforePopup and this will resolve issue with alert focus. In qt4.py and tkinter_.py and hello_world.py examples focus works fine in the popup window.
Turned out this wasn't a simple task of copy/paste from upstream client, there were several issues that needed fixes. Done!
Upstream CEF 51 is now using X11 library for window management. Previously it used GTK. Now with X11 under the hood there are no default implementations for dialogs in libcef on Linux and that includes: print dialog, js dialogs, file dialog. However the cefclient sample application provides implementations for these dialogs using the GTK library. But it needs to be copied with a few minor modifications. Print dialog was already implemented in Issue #238 by copying print_handler_gtk.cc / print_handler_gtk.h files almost entirely.
To implement js/file dialogs copy these two files from upstream cefclient:
Also copy some code from cefclient's client_handler.h/client_handler.cc and add it somewhere in cefpython's src/client_handler/client_handler.cpp/h files:
This will require a bit more of modifications than it was required when copying Print dialog. That's because we already expose JSDialogHandler callbacks to python:
https://github.com/cztomczak/cefpython/blob/master/api/JavascriptDialogHandler.md
So the code needs to be modified to take into account that if there is a JavascriptDialogHandler callback provided in Python then use it, otherwise use the default implementation copied from cefclient. This might require modifying the javascript_dialog_handler.pyx file.
The text was updated successfully, but these errors were encountered: