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');
|
||||
})();
|
||||
@@ -0,0 +1,94 @@
|
||||
(function installRemotePopupCleanup(WandEnhancer) {
|
||||
if (globalThis.__wandRemotePopupCleanupInstalled) {
|
||||
return;
|
||||
}
|
||||
|
||||
globalThis.__wandRemotePopupCleanupInstalled = true;
|
||||
|
||||
const style = document.createElement('style');
|
||||
style.id = 'wand-remote-popup-cleanup-style';
|
||||
style.textContent = `
|
||||
remote-tooltip .remote-tooltip .top-wrapper,
|
||||
remote-tooltip .remote-tooltip .remote-tooltip-section-divider,
|
||||
remote-tooltip .remote-tooltip .instructions .header,
|
||||
remote-tooltip .remote-tooltip .instructions .content .text,
|
||||
remote-tooltip .remote-tooltip .instructions .platforms {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
remote-tooltip .remote-tooltip .instructions-wrapper {
|
||||
margin: 0 !important;
|
||||
padding: 18px !important;
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
remote-tooltip .remote-tooltip .instructions,
|
||||
remote-tooltip .remote-tooltip .instructions .content {
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
padding: 0 !important;
|
||||
gap: 0 !important;
|
||||
}
|
||||
|
||||
remote-tooltip .remote-tooltip .instructions remote-qr-code {
|
||||
all: unset !important;
|
||||
--wand-qr-size: clamp(220px, 100vw, 300px);
|
||||
width: var(--wand-qr-size) !important;
|
||||
height: var(--wand-qr-size) !important;
|
||||
min-width: var(--wand-qr-size) !important;
|
||||
min-height: var(--wand-qr-size) !important;
|
||||
max-width: var(--wand-qr-size) !important;
|
||||
max-height: var(--wand-qr-size) !important;
|
||||
flex: 0 0 var(--wand-qr-size) !important;
|
||||
aspect-ratio: 1 / 1 !important;
|
||||
display: block !important;
|
||||
border-radius: 12px !important;
|
||||
overflow: hidden !important;
|
||||
transform: none !important;
|
||||
box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35) !important;
|
||||
}
|
||||
|
||||
remote-tooltip .remote-tooltip .instructions remote-qr-code canvas {
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
aspect-ratio: 1 / 1 !important;
|
||||
display: block !important;
|
||||
object-fit: contain !important;
|
||||
image-rendering: pixelated !important;
|
||||
border-radius: 12px !important;
|
||||
transform: none !important;
|
||||
}
|
||||
`;
|
||||
|
||||
const installStyle = () => {
|
||||
if (!document.getElementById(style.id)) {
|
||||
document.head.appendChild(style);
|
||||
}
|
||||
};
|
||||
|
||||
const updateLinks = () => {
|
||||
const remoteUrl = globalThis.__wandRemoteBridgeUrl || WandEnhancer?.remoteUrl;
|
||||
if (!remoteUrl) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (const anchor of document.querySelectorAll('remote-tooltip a[href]')) {
|
||||
anchor.setAttribute('href', remoteUrl);
|
||||
anchor.textContent = remoteUrl.replace(/\/$/, '');
|
||||
}
|
||||
};
|
||||
|
||||
installStyle();
|
||||
updateLinks();
|
||||
|
||||
const observer = new MutationObserver(() => {
|
||||
installStyle();
|
||||
updateLinks();
|
||||
});
|
||||
|
||||
observer.observe(document.documentElement, {
|
||||
childList: true,
|
||||
subtree: true,
|
||||
});
|
||||
})(globalThis.WandEnhancer);
|
||||
Reference in New Issue
Block a user