Closed pchainho closed 8 years ago
@pchainho I did the changes but I can't test them because this https://github.com/reTHINK-project/dev-runtime-core/issues/102, btw I found another problem https://github.com/reTHINK-project/dev-service-framework/issues/52
@pchaino what do you mean with close runtime browser? I only have exposed the close method on runtime to app developer, is required something more?
The close() function is to be called by the runtime browser when you detect browser window / tab close events. Having a function exposed to App developers is also nice
@pchainho I afraid we can't postpone browser window/tab close until runtimeUA.close returns. There are some technics but all of them are poor options. In addition we can face another problem here:
User agents will typically ignore asynchronous XMLHttpRequests made in an unload handler. from: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon
I don't know about websocket.
How would you like to proceed?
let's invoke close() even if we don't guarantee the window/tab close is blocked until the promise is resolved. At least we've tried to unregister components. If not successful, the Domain Registry is currently able to "clean dead" registry entries
done in c024ae2bd2d00e557780fe47fe8c58692f82424c
The Browser Runtime should only be closed when the runtimeUA.close() promise is resolved ie after unregister all Hyperty instances.
See https://github.com/reTHINK-project/dev-runtime-core/issues/89