Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It is possible to open Debug window using ?debug in production mode #102

Closed
TatuLund opened this issue Nov 12, 2021 · 0 comments
Closed
Assignees
Labels

Comments

@TatuLund
Copy link

If you run Vaadin 14.7 / Vaadin 8.14 + MPR app running jetty:run -Pproduction and using profile settings as documented, Vaadin 8 will adopt the production mode setting correctly in the server side. However you can still open the Debug window using ?debug query parameter in the url when using non-root Routes. The debug variable is true in client side but production mode status is false in the server side,

Workaround is to force the debug to be false when root layout is attached.

	@Override
	public void onAttach(AttachEvent event) {
		if (event.getSession().getService().getDeploymentConfiguration().isProductionMode()) {
			event.getUI().getPage().executeJs("window.vaadin.debug=false;");
		}
	}

You can demonstrate this by checking server side production mode

https://github.com/TatuLund/mpr-demo/blob/dfe3ba7342e4b18567f9dec30d4fb40ffb934e52/src/main/java/org/vaadin/mprdemo/MyUI.java#L54

Complete demo

https://github.com/TatuLund/mpr-demo/tree/mpr-4

@caalador caalador self-assigned this Nov 29, 2021
@caalador caalador closed this as completed Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants