mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-16 07:30:02 -04:00
YUes I am god
This commit is contained in:
parent
5024e19c08
commit
c61e62ec91
6 changed files with 56 additions and 8 deletions
26
src/client/shared/realm.ts
Normal file
26
src/client/shared/realm.ts
Normal file
|
@ -0,0 +1,26 @@
|
|||
import { ScramjetClient } from "../client";
|
||||
import { config } from "../shared";
|
||||
|
||||
export const POLLUTANT = Symbol.for("scramjet realm pollutant");
|
||||
|
||||
export default function (client: ScramjetClient, self: typeof globalThis) {
|
||||
// object.$setrealm({}).postMessage(...)
|
||||
// the empty object is the "pollutant" which can reconstruct the real realm
|
||||
// i explain more in postmessage.ts
|
||||
Object.defineProperty(self.Object.prototype, config.setrealmfn, {
|
||||
value(pollution: {}) {
|
||||
// this is bad!! sites could detect this
|
||||
Object.defineProperty(this, POLLUTANT, {
|
||||
value: pollution,
|
||||
writable: false,
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
});
|
||||
|
||||
return this;
|
||||
},
|
||||
writable: false,
|
||||
configurable: false,
|
||||
enumerable: false,
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue