gwt jsni document.documentElement.style.height

Zeh*_*n12 0 javascript java gwt jsni

我尝试使用gwt jsni 从此链接/sf/answers/637028451/调用代码 .

我的方法看起来像

  public static native void hideAddressBar() /*-{
        if (document.documentElement.scrollHeight < $wnd.outerHeight * $wnd.devicePixelRatio) {
            document.documentElement.style.height = ($wnd.outerHeight * $wnd.devicePixelRatio) + 'px';
        }
        setTimeout($wnd.scrollTo(1, 1), 0);
  }-*/;
Run Code Online (Sandbox Code Playgroud)

但是当我打电话给它时,没有任何反应.

我的问题:是不是可以设置document.documentElement.style.heightgwt jsni 的值?