[crosscode] re-export game execution context in btw-i-use-arch-mod

This commit is contained in:
Dmytro Meleshko 2020-03-09 18:22:03 +02:00
parent f8e9206692
commit 1bca05325f
2 changed files with 8 additions and 1 deletions

View File

@ -2,5 +2,6 @@
"name": "btw I use Arch",
"version": "0.0.0",
"description": "A mod for masochists like myself",
"prestart": "prestart.js"
"prestart": "prestart.js",
"preload": "preload.js"
}

View 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;