I’m seeing a strange behavior on Firefox when I use a BrowserFrame to display a PDF on a window and then close the window.
I have a BrowserFrame declared like this, where the getStream method gets the content of a PDF file from an ECM.
[code]
StreamSource s = new StreamResource.StreamSource() {
@Override
public InputStream getStream() {
try {
return ui.getRestClient().getContent((String) selectedDoc.getPropertyValueById(“cmis:versionSeriesId”));
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
};
StreamResource r = new StreamResource(s, (String) selectedDoc.getPropertyValueById("cmis:name"));
e = new BrowserFrame(null, r);
e.setHeight("100%");
e.setWidth("100%");
[/code]The BrowserFrame is then added to a Window and the window is displayed.
This works perfectly, but something weird happens when I call theWindow.close() or theWindow.setVisible(false) on Firefox: a new Window or Tab is opened and the PDF’s content is displayed. The window’s URL is http://localhost:8080/AppName/APP/connector/0/202/source/fileName.pdf
I think that somehow Firefox is trying to keep showing the frame even when the window is closed. I’ve tried setting the BrowserFrame to null, and removing it before closing the window but it still happens.
This new Window/Tab doesn’t appear when testing with Chrome.
Any ideas as to what could be happening are appreciated.