Page 1 of 1

Window.Current.SizeChanged not working in Edge Chromium

Posted: Tue Nov 26, 2019 2:05 am
by fangeles
Hi,

I have noticed that the Window.Current.SizeChanged is not working on the latest Dev channel of Microsoft Edge Chromium.

Reference versions are below:

-Microsoft Edge Chromium Version 80.0.334.3 (Official build) dev (64-bit)
-CSHTML5 2.0.0-alpha51-071


It is working fine on latest version of Google Chrome.

Thanks.

Re: Window.Current.SizeChanged not working in Edge Chromium

Posted: Tue Nov 26, 2019 2:13 am
by JS-Support @Userware
Hi,

CSHTML5 uses the "onresize" event of the JS "window" class, as shown at line 145 of the "Window.cs" class:
https://github.com/cshtml5/CSHTML5/blob ... /Window.cs

Could you please test the following JSFiddle and report whether the size of the window is reported correctly when you resize the window?
https://jsfiddle.net/api/mdn/

Thanks

Re: Window.Current.SizeChanged not working in Edge Chromium

Posted: Tue Nov 26, 2019 2:15 am
by fangeles
The page reported 404

https://jsfiddle.net/api/mdn/

Re: Window.Current.SizeChanged not working in Edge Chromium

Posted: Tue Nov 26, 2019 2:19 am
by fangeles
Attached is the result on the console once I change the browser size:

Re: Window.Current.SizeChanged not working in Edge Chromium

Posted: Tue Nov 26, 2019 2:31 am
by JS-Support @Userware
Thanks.

Here is the correct JSFiddle link:
http://jsfiddle.net/ostapische/AkqP4/

Re: Window.Current.SizeChanged not working in Edge Chromium

Posted: Tue Nov 26, 2019 3:02 am
by fangeles
I have tested it, width and height is retrieved successfully when viewed on Edge Chromium.

Re: Window.Current.SizeChanged not working in Edge Chromium

Posted: Tue Nov 26, 2019 7:12 am
by JS-Support @Userware
Could you please check the option "Pause on caught exceptions" as shown on the following page:
http://www.cshtml5.com/documentation/ti ... javascript

and then, when the exception is raised, move up the call stack until you arrive in the code of "CSHTML5.js". There you can see why the error happens.

The JavaScript code that you see there should be very similar to the original C# code at:
https://github.com/cshtml5/CSHTML5

If you wish to modify that C# code to fix this issue, and recompile to "CSHTML5.js", you will find a tutorial at the GitHub link above.

Thanks a lot.