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.

StreamSource s = new StreamResource.StreamSource() {
public InputStream getStream() {
try {
return ui.getRestClient().getContent((String) selectedDoc.getPropertyValueById(“cmis:versionSeriesId”));
} catch (Exception e) {
return null;

    StreamResource r = new StreamResource(s, (String) selectedDoc.getPropertyValueById("cmis:name"));
    e = new BrowserFrame(null, r);

[/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));
PrimaryButton btn = new PrimaryButton("Close");
MVerticalLayout winContent = new MVerticalLayout()
    .with(pdf, btn)
    .withAlign(btn, Alignment.MIDDLE_CENTER);

//Window creation
MWindow win = new MWindow("View PDF");
win.setWidth(90, Unit.PERCENTAGE);
win.setHeight(90, Unit.PERCENTAGE);

//Window opening

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

Thanks in advance.