跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

提交记录
修改desktop/linux/cage-desktop.c+4 −2看文件
@@ -737,9 +737,11 @@ static void install_bridge(void) {
737737 char *code = g_strdup_printf(
738738 "(()=>{'use strict';window.cageLinuxBridgeInit='injected';if(window!==window.top||location.protocol!=='http:'||location.hostname!=='localhost'||location.port!=='%d')return;"
739739 "window.cageLinuxBridgeInit='origin-valid';window.cageNativeIMEAvailable=true;try{"
740删除: "const transport=window.webkit.messageHandlers.cageTransport;const token=%s;"
740新增: "const handlers=window.webkit.messageHandlers,transport=handlers.cageTransport;const token=%s;"
741741 "const cage=Object.freeze({postMessage(request){return transport.postMessage({token,request});}});"
742删除: "Object.defineProperty(window.webkit.messageHandlers,'cage',{value:cage,writable:false,configurable:false});"
742新增: "Object.defineProperty(handlers,'cage',{value:cage,writable:false,configurable:false});"
743新增: /* Keep the WebKit wrapper alive for this document so its custom cage property survives GC. */
744新增: "Object.defineProperty(window,'cageLinuxMessageHandlers',{value:handlers});"
743745 "window.cageLinuxBridgeInit='ready';}catch(error){window.cageLinuxBridgeInit=error.name;}"
744746 "})();", app.port, token);
745747 /* The host allowlist narrows injection; the script and native receiver