"Communication problem" in iframe tabs

Hi,

We embedded a Vaadin AP in an iframe html such as:

<html><iframe src=" https://demo.vaadin.com/sampler/#ui/interaction/button"   style="WIDTH:100%" height="100%" name="test"></iframe></html>

If open the html twice (two tabs) in the same browser window, and switch between these two tabs, the previous used tab will show “Communication problem. Take note of any unsaved data, and click here to continue.”

The problem happened in Vaadin Version 7.7.12 or upper (like Vaddin web), but not happened in Vaadin Version 7.1.10.

If removed iframe name, such as:

<html><iframe src=" https://demo.vaadin.com/sampler/#ui/interaction/button"   style="WIDTH:100%" height="100%"></iframe></html>

Everything is fine.

Why the iframe name will affect connection in newer Vaadin version? Any ideas? Many thanks,

Hi,

Because we cannot control the iframe, finally we override the window.name in Vaadin code to avoid the same name issue.

We tried to add Servlet which extends VaadinServlet and then add SessionInitListener which overwrite modifyBootstrapPage to add script.

Sample code as below for your references.

public class AppUI extends UI {

	@WebServlet( value = "/*", asyncSupported = true )	
	@VaadinServletConfiguration(productionMode = false, ui = AppUI.class)
	public static class Servlet extends VaadinServlet {
		@Override
		protected void servletInitialized() throws ServletException {
			super.servletInitialized();

			getService().addSessionInitListener(new AppSessionInitListener());
		}
	}
public class AppSessionInitListener implements SessionInitListener {

	@Override
	public void sessionInit(final SessionInitEvent event) throws ServiceException {

		event.getSession().addBootstrapListener(new BootstrapListener() {

			@Override
			public void modifyBootstrapPage(final BootstrapPageResponse response) {

				final Element head = response.getDocument().head();

				head.appendElement("script").text(" window.name = 'app' + Date.now(); ");

			}

			@Override
			public void modifyBootstrapFragment(final BootstrapFragmentResponse response) {
			}
		});
	}

}

Is Vaadin considered to fix this issue in the future? Many thanks.