简体   繁体   中英

SWT listener for JavaScript window.resizeTo?

I'm working on an application that uses the SWT Browser widget to display an HTML page with some JavaScript in it. The JavaScript tries to use window.resizeTo to change the size of the window, but it currently isn't having any effect.

I've fiddled with the browser settings, and it doesn't seem to be an issue with the underlying browser; switching between Mozilla and Internet Explorer rendering engines has no effect. I suspect that SWT simply doesn't automatically re-size the window in response to JavaScript functions.

I can easily re-size the window from my Java code, but I need to know when to re-size it, and how big JavaScript wants it to be. Does SWT provide a way to listen for this? If so, how?

I still don't know of any way to get this information, but a work-around is to change SWT versions. Some of them implement JavaScript's window.resizeTo automatically, and some of them do not.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM