Set window to full screen from cocos2d-x 3 javascript

Is there a way to set the window to full screen from javascript in cocos2d-x 3?
I would like to add an option in my game to set the window to full screen or to windowed mode (Mas OS, Windows, Linux). Is it possible to do this directly from the javascript?

I already asked the question there: http://stackoverflow.com/q/20787992/171711 , but there seems to be no one with an answer so far:

js or jsb?
cc.EGLView.getInstance().setDesignResolutionSize(800, 450, cc.RESOLUTION_POLICY.SHOW_ALL);
in main.js.

jsb. Unfortunately the result is the same window with deformed content.
Additionally:

cc.Director.getInstance().getWinSize();

Reports the new EGLView parameters but the wrong window size.

Is there a way to change the actual window size?

in jsb. recommend you to use pEGLView->setDesignResolutionSize in AppDelegate.cpp.