feat: add draggable panel and restrict assistant to site directory
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user