mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
[crosscode] re-export game execution context in btw-i-use-arch-mod
This commit is contained in:
parent
f8e9206692
commit
1bca05325f
2 changed files with 8 additions and 1 deletions
|
@ -2,5 +2,6 @@
|
||||||
"name": "btw I use Arch",
|
"name": "btw I use Arch",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"description": "A mod for masochists like myself",
|
"description": "A mod for masochists like myself",
|
||||||
"prestart": "prestart.js"
|
"prestart": "prestart.js",
|
||||||
|
"preload": "preload.js"
|
||||||
}
|
}
|
||||||
|
|
6
crosscode/btw-i-use-arch-mod/preload.js
Normal file
6
crosscode/btw-i-use-arch-mod/preload.js
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
// I know that this is legacy feature provided by CCLoader way back when mods
|
||||||
|
// weren't executed inside the game iframe's context, but it is useful
|
||||||
|
// nevertheless because console in Chrome's devtools automatically selects
|
||||||
|
// window.top as the execution context by default, so writing `cc.` is faster
|
||||||
|
// than `modloader.frame.contentWindow`
|
||||||
|
window.top.cc = window;
|
Loading…
Reference in a new issue