I have a problem that requires me to hide/change the actual window size of my browser from the web server. I mean the web server should learn wrong information about my actual agent window size. For instance, If my actual window size is X * Z, the server should read it as X/4 * Z/4. Is this possible?
Note: I do not want to use headless browsing or any other detectable technique. I just want my normal web browser to hide its actual windowsize information.
The server can't interrogate the browser, but a script running in the browser can obtain those details and send them to the server. However, even then, you can't control what the browser does, even knowing that information. What you describe sounds just like the mobile testing modes in most browsers, and any script running those modes will report the "faked" screen size to the server via such scripts. In chrome, show dev tools, click this icon:
Then at the top you can select different screen sizes, including a bunch or presets and orientations:
Any script running in that mode will report the emulated size.