BrowserFrame + Window.close causes a new tab on Firefox

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.

Hello everybody!
I’m experiencing the very same issue with Vaadin 7.5.5.

I have a BrowserFrame inside a Window and, when the window is closed, FireFox (version 53.0.3) close the window and opens a new tab.

Here is my code:

//Window content creation
File pdfFile = new File("fileToShow.pdf");
BrowserFrame pdf = new BrowserFrame("", new FileResource(pdfFile));
pdf.setSizeFull();
PrimaryButton btn = new PrimaryButton("Close");
btn.addClickListener(win::close);
MVerticalLayout winContent = new MVerticalLayout()
    .withSpacing(true)
    .with(pdf, btn)
    .expand(pdf)
    .withAlign(btn, Alignment.MIDDLE_CENTER);

//Window creation
MWindow win = new MWindow("View PDF");
win.setClosable(true);
win.setModal(false);
win.setResizable(true);
win.setWidth(90, Unit.PERCENTAGE);
win.setHeight(90, Unit.PERCENTAGE);
win.setContent(winContent);

//Window opening
getUI().addWindow(win);

Is this a known bug which will be fixed or does at least anybody knows a workaround?

Thanks in advance.