feat: add draggable panel and restrict assistant to site directory

This commit is contained in:
薇星幻海
2026-10-12 14:19:31 +08:00
parent 3d7a1ffed0
commit 20abb33740
12 changed files with 968 additions and 77 deletions
+14
View File
@@ -0,0 +1,14 @@
/* Shared URL boundary for userscript injection and same-page navigation. */
const YianSiteScope = (function () {
'use strict';
const origin = 'http://10.119.67.7';
const basePath = '/clientcn/';
function isAllowedURL(value) {
try {
const url = new URL(String(value));
return url.origin === origin && url.pathname.startsWith(basePath);
} catch (_) { return false; }
}
return Object.freeze({ origin, basePath, isAllowedURL });
})();
if (typeof window === 'undefined' && typeof module !== 'undefined' && module.exports) module.exports = YianSiteScope;