mirror of
https://github.com/k1tbyte/Wand-Enhancer.git
synced 2026-08-29 01:08:51 +00:00
Release 1.0.7.0: Remote Web Panel & Stability Fixes
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
# Custom Renderer Scripts
|
||||
|
||||
Place user scripts here as plain `.js` files before running the Wand patch.
|
||||
|
||||
During patching, Wand Enhancer copies default scripts from `web-panel/scripts/default` and user scripts from this folder into `remote-panel/renderer-scripts` inside `app.asar`. Scripts are loaded in filename order on every Wand renderer startup.
|
||||
|
||||
Each script runs in the Wand renderer and receives a small global API:
|
||||
|
||||
```js
|
||||
(function (WandEnhancer) {
|
||||
WandEnhancer.log('custom script loaded', WandEnhancer.remoteUrl);
|
||||
})(globalThis.WandEnhancer);
|
||||
```
|
||||
|
||||
Use unique global guards for repeat-safe scripts because the renderer can be reinjected after navigation.
|
||||
@@ -0,0 +1,8 @@
|
||||
(function installUserHudMarker(WandEnhancer) {
|
||||
if (globalThis.__wandEnhancerUserHudMarkerInstalled) {
|
||||
return;
|
||||
}
|
||||
|
||||
globalThis.__wandEnhancerUserHudMarkerInstalled = true;
|
||||
WandEnhancer.log('user script loaded', WandEnhancer.remoteUrl);
|
||||
})(globalThis.WandEnhancer);
|
||||
@@ -0,0 +1,8 @@
|
||||
(() => {
|
||||
if (document.documentElement.dataset.wandEnhancerCustomScript === 'loaded') {
|
||||
return;
|
||||
}
|
||||
|
||||
document.documentElement.dataset.wandEnhancerCustomScript = 'loaded';
|
||||
console.info('[Wand Enhancer] Custom renderer script loaded');
|
||||
})();
|
||||
Reference in New Issue
Block a user