-
Notifications
You must be signed in to change notification settings - Fork 48
Description
Is your feature request related to a problem? Please describe.
I would like to be able to use updateKeys with anonymous functions like this SafeExamBrowser.security.updateKeys(() => { ... }). Currently the argument of updateKeys needs to be a named function.
Describe the solution you'd like
I understand that updateKeys depends on the postMessage mechanism that can only send strings, but it should be possible for SEB to generate ID for any function it receives and keep a map from IDs to functions.
| window.webkit.messageHandlers.updateKeys.postMessage(callback.name); |
Describe alternatives you've considered
I can store the anonymous callbacks in an array myself and provide a global function that calls all of them, then use this global function as callback for SEB. But this adds complexity to client code and pollutes the global namespace.
Additional context
I ran into this issue on MacOS with SEB 3.6, didn't check iOS.