compat: make spoofed orientation reflect spoofed screen dimensions [1607032 + 1918202]
edit: upstream
- https://bugzilla.mozilla.org/show_bug.cgi?id=1607032
- https://bugzilla.mozilla.org/show_bug.cgi?id=1918202
RFP spoofs landscape on devices
However css @media orientation and also matchMedia leak - see upcoming attached pic where RFP=on, the phone is in reality in portrait mode. Orientation = landscape (spoofed), but the others say otherwise
mdn (this is what gets spoofed) https://developer.mozilla.org/en-US/docs/Web/API/Screen/orientation#Example
var orientation = screen.msOrientation || (screen.orientation || screen.mozOrientation
css (leaks)
@media (orientation:portrait){#YourID:after{content:"portrait";}}
@media (orientation:landscape){#YourID:after{content:"landscape";}}
matchMedia (leaks)
if (window.matchMedia("(orientation: portrait)").matches) return "portrait";
if (window.matchMedia("(orientation: landscape)").matches) return "landscape";
Edited by Thorin