dom: expose browser window constructor identity

This commit is contained in:
SGavrl committed 2026-07-26 20:07:45 +00:00
1 parent 37f6c93af9
commit 9dfc67af74
2 files changed
+28

No files matched your search

+17
View File
@@ -1809,6 +1809,23 @@ mod tests {
assert_eq!(title, serde_json::json!("Test Page"));
}
#[test]
fn global_window_has_browser_constructor_identity() {
let mut rt = setup_runtime("<html><body></body></html>");
let result = rt
.evaluate(
"return [window === self, self.constructor === Window,\
window instanceof Window, self.document === document,\
self.location === location, self.history === history,\
self.navigator === navigator];",
)
.unwrap();
assert_eq!(
result,
serde_json::json!([true, true, true, true, true, true, true])
);
}
#[test]
fn explicit_viewport_is_distinct_from_fingerprinted_screen() {
let dom = parse_html("<html><body></body></html>");