MacOS + WebView resize problem.

I encountered a problem when using webviews in MacOS builds/Simulator

If the content of the webView is resized or moved with javascript code calls like:

window.resizeTo window.resizeBy window.moveTo window.moveBy

the whole application window of the MacOS application resizes/moves. Even if resizable is set to false in the build.settings.

This happens if eg. you press a facebook button (where the facebook login popup would normally appear)

Would be nice if this behaviour could be blocked. 

Should I consider this a bug and send a bug report?

A bug report would be great.

Thanks

Rob

Hi Rob

I submitted a bug report right after your post, but I didn’t receive a confirmation email… so I am not sure it came through.

These emails are usually sent out automatically right away when the report was received right?

Just wondering if I should resubmit it.

Thanks, Jacob

I don’t see a submission by searching for your email.

Rob

I resubmitted the bug report but still no confirmation email…

Well the bug is quite easy to reproduce with this code:

-- main.lua  local webView = native.newWebView( display.contentCenterX, display.contentCenterY, display.contentWidth, display.contentHeight ) webView:request( "http://www.shakebrowser.net/resize.html" )

-- build.settings settings = {      osx = {           plist = { NSAppTransportSecurity = { NSAllowsArbitraryLoads = true }, },      },      orientation = { default = "landscapeRight", }, }

The webpage requested was created by me to demonstrate the problem. 

It contains the following code:

&nbsp; &nbsp;\<!DOCTYPE html\> &nbsp; &nbsp; \<html\> &nbsp; &nbsp; \<body\> &nbsp; &nbsp; \<button onclick="resizeWin()"\>Resize window\</button\> &nbsp; &nbsp; \<button onclick="openWin()"\>Open new window\</button\> &nbsp; &nbsp; \<button onclick="moveWin()"\>Move window\</button\> &nbsp; &nbsp; \<script\>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; function resizeWin() { window.resizeTo(250, 250);}&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; function openWin() {window.open("", "", "width=100, height=100");} &nbsp; &nbsp; &nbsp; &nbsp; function moveWin() {window.moveBy(250, 250);} &nbsp; &nbsp; \</script\> &nbsp; &nbsp; \</body\> &nbsp; &nbsp; \</html\>

What form are you using to submit the bug?

This one: 

https://developer.coronalabs.com/content/bug-submission

And it shows a “thank you the bug was submitted page” after i hit the submit button

I believe our engineers actually addressed this in the next daily build.

Rob

That is great. Thanks

Current browsers ignore these calls and Corona apps (and the Simulator) should too.

This will be fixed in Daily Build CoronaSDK 2016.2995 or later. 

Thanks Perry. 

Actually current version of Safari on MacOS don’t ignore these calls (unless you have more than one tab open).

Current versions of Chrome and Firefox ignore them. 

Anyway great to hear it is fixed in Corona.

A bug report would be great.

Thanks

Rob

Hi Rob

I submitted a bug report right after your post, but I didn’t receive a confirmation email… so I am not sure it came through.

These emails are usually sent out automatically right away when the report was received right?

Just wondering if I should resubmit it.

Thanks, Jacob

I don’t see a submission by searching for your email.

Rob

I resubmitted the bug report but still no confirmation email…

Well the bug is quite easy to reproduce with this code:

-- main.lua&nbsp; local webView = native.newWebView( display.contentCenterX, display.contentCenterY, display.contentWidth, display.contentHeight ) webView:request( "http://www.shakebrowser.net/resize.html" )

-- build.settings settings = { &nbsp; &nbsp; &nbsp;osx = { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; plist = { NSAppTransportSecurity = { NSAllowsArbitraryLoads = true }, }, &nbsp; &nbsp; &nbsp;}, &nbsp; &nbsp; &nbsp;orientation = { default = "landscapeRight", }, }

The webpage requested was created by me to demonstrate the problem. 

It contains the following code:

&nbsp; &nbsp;\<!DOCTYPE html\> &nbsp; &nbsp; \<html\> &nbsp; &nbsp; \<body\> &nbsp; &nbsp; \<button onclick="resizeWin()"\>Resize window\</button\> &nbsp; &nbsp; \<button onclick="openWin()"\>Open new window\</button\> &nbsp; &nbsp; \<button onclick="moveWin()"\>Move window\</button\> &nbsp; &nbsp; \<script\>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; function resizeWin() { window.resizeTo(250, 250);}&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; function openWin() {window.open("", "", "width=100, height=100");} &nbsp; &nbsp; &nbsp; &nbsp; function moveWin() {window.moveBy(250, 250);} &nbsp; &nbsp; \</script\> &nbsp; &nbsp; \</body\> &nbsp; &nbsp; \</html\>

What form are you using to submit the bug?

This one: 

https://developer.coronalabs.com/content/bug-submission

And it shows a “thank you the bug was submitted page” after i hit the submit button

I believe our engineers actually addressed this in the next daily build.

Rob