js: mark Event constructor as native for stealth compatibility

Mark the Event constructor as native so that Event.toString() returns "[native code]" instead of leaking the JavaScript implementation. This closes a stealth fingerprinting vector.
This commit is contained in:
Gabriel authored and GitHub committed 2026-06-17 14:54:15 +00:00
commit 1a3888c056
1 file changed
+1
+1
View File
@@ -4023,6 +4023,7 @@ globalThis.Event = class Event {
return path;
}
};
_markNative(Event);
globalThis.CustomEvent = class extends Event {
constructor(t,o={}) { super(t,o);this.detail=o.detail; }
// Legacy DOM Level 2 init; some libraries (Starbucks China bundle, older