A window (A) that was created  by another window (B) closes itself by window.close() I see following exception that is not caught at line 104. For addEventListener I don't reason for try-catch -- works fine without as well. 

When using https://github.com/sailfishos/sailfish-browser/tree/newWebView I see that window at UI side (quickmozview) got destroyed before EmbedLiteErrorPageHandler::onWindowClose gets called.

************************************************************
* Call to xpconnect wrapped JSObject produced this error:  *
[Exception... "[JavaScript Error: "Services.embedlite.chromeEventHandler(...) is null" {file: "file:///usr/lib/mozembedlite//components/EmbedLiteErrorPageHandler.js" line: 104}]'[JavaScript Error: "Services.embedlite.chromeEventHandler(...) is null" {file: "file:///usr/lib/mozembedlite//components/EmbedLiteErrorPageHandler.js" line: 104}]' when calling method: [nsIObserver::observe]"  nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)"  location: "native frame :: <unknown filename> :: <TOP_LEVEL> :: line 0"  data: yes]
************************************************************
EmbedLiteExt EmbedTouchManager:WindowDestroyed:117: WindowClosed: 0x545a0e30
EmbedLiteExt EmbedChromeManager:WindowDestroyed:118: WindowClosed: 0x545a0e30