Help with WebGL resolution after build

Hello. I’m having issue after building for WebGL.

  1. Make a image of 1366x768. (Pixel per unit = 100)
  2. Place the image at x 0 and y 0
  3. Create a script and in the Awake function force the wanted resolution Screen.SetResolution (1366, 768, false);
  4. Main Camera size = 3.84
  5. Build for Windows, Max, Linux (Target Platform = Windows)

It works perfect. No problems at all

  1. Switch Platform to WebGL
  2. Project Settings → Player → Resolution and Presentation → Default Canvas Width = 1366, Default Canvas Height = 768
  3. Build And Run

Resolution is wrong and the camera position according to the imagen is wrong.
Searching for anything related to “Unity resolution” only bring unrelated answers to my particular problem. I don’t know what I’m doing wrong for the WebGL build. Any help/tip is more than welcome, I leave some screenshots for better understanding.

The first image is the Windows build, and under it are the settings and only line of code.
The second image with the magenta column is the WebGL build, clearly not a 1366x768 resolution, and under it the settings for the web build.

its a white screen, so in the second, Im not sure what we’re looking at, but its also a white screen.

PWA will full screen say on my phone but not on a PC…

First image “WBuild” is the Windows Build working as expected. A build with the desire resolution (1366x768).
Second image “WebBuild” you see the exact same image imported in to Unity Scene. As you can see the resolution is not 1366x768, and the pink color is the Background solid color of the Main Camera, suggesting that the aspect ratio or resolution is incorrect.

I move to Unity 2023.1.0f1 and the WebGL build work as expected. It seems some type of version specific problem.
Here is a screenshot of the build running on Brave at the desired resolution (1366x768)