seb-win-refactoring: Popup Creation Fails
When opening a new window/tab with JavaScript, unlike all other browsers, SEB returns null in method window.open(...)'. As a result, setting the URL in the second statement does not work.
var targetWindow = window.open("","_blank");
...
targetWindow.location.href = '<the real url>';
_Originally posted by @uhensler in https://github.com/SafeExamBrowser/seb-win-refactoring/discussions/228#discussioncomment-1604061_
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 50 (28 by maintainers)
Commits related to this issue
- SEBWIN-531, #240: Refactored browser application instance to browser window. — committed to SafeExamBrowser/seb-win-refactoring by dbuechel 2 years ago
- SEBWIN-531, #240: Replaced custom life span handler implementation with new API of the browser engine in order to enable parent-child relationship / JavaScript functionality for popup windows. — committed to SafeExamBrowser/seb-win-refactoring by dbuechel 2 years ago
- adapt accessibility changes to SEBWIN-531, #240 changes (7142380) — committed to yolpsoftware/seb-win-refactoring by yolpsoftware 2 years ago
- adapt accessibility changes to SEBWIN-531, #240 changes (7142380) — committed to yolpsoftware/seb-win-refactoring by yolpsoftware 2 years ago
We have added the mentioned code of the University of Zurich to the public release of OpenOlat. This allows the use of the SEB JavaScript API.
This code does not solve the problem of opening a new window/tab on SEB for macOS. The JavaScript variable
windowis alwaysnull, so there is an exception. This seems to be and bug in the SEB. Can you please look into this?In the GUI this leads to a popup with the message “Quit Safe Exam Browser: Are you sure you want to quit Safe Exam Browser?”.
There is no version 3.4 for Mac yet, the latest stable version 3.1 will be released later this week. From the above mentioned page you can get a release candidate version.
Commit https://github.com/cefsharp/CefSharp.MinimalExample/commit/34650112db2f7f1a6e030e0c4b2846cf331630ae added a basic example to the
MinimalExample.The key parts
It’s basically:
ChromiumHostControlandChromiumWebBrowserinstances (copy and paste stuff)Starting at https://github.com/cefsharp/CefSharp.MinimalExample/commit/34650112db2f7f1a6e030e0c4b2846cf331630ae#diff-6e4d5ea533ed7108e6bb21e0fde5a0d7816987945c557900904aaedf05ab6864 is an actual example.
See https://github.com/cefsharp/CefSharp.MinimalExample/tree/chromiumhostcontrol for an updated example.
htmlabove was turned into https://cefsharp.github.io/demo/openpopup.html to simplify testing.For common events I’m open to adding them directly in
CefSharp(they’ll need to be added to all theWinForms,WPF,WPF.HwndHostandOffScreenimplementations, so there’s a bit of work there.Not sure why you’d want the extra complexity, would it actually be necessary to create an extra code path?. If the answer is yes then that’s totally upto to you (simple enough to do).