diff --git a/src/main.tsx b/src/main.tsx
index af6d7deb58c6ee40127d0281110438feb7b5a74c..2c0d0c40bef1d6ab583d4f5f03157548474ea247 100644
--- a/src/main.tsx
+++ b/src/main.tsx
@@ -6,6 +6,9 @@ import ReactDOM from "react-dom";
 import { RecoilRoot } from "recoil";
 import { BrowserRouter } from "react-router-dom";
 import Layout from "./pages/_layout";
+import setup from "./services/enhance";
+
+setup();
 
 ReactDOM.render(
   <React.StrictMode>
diff --git a/src/services/enhance.ts b/src/services/enhance.ts
new file mode 100644
index 0000000000000000000000000000000000000000..6d42355fc095acc956d327d7af2a30e68d47a23e
--- /dev/null
+++ b/src/services/enhance.ts
@@ -0,0 +1,22 @@
+import { emit, listen } from "@tauri-apps/api/event";
+import { CmdType } from "./types";
+
+export default function setup() {
+  listen("script-handler", (event) => {
+    const payload = event.payload as CmdType.EnhancedPayload;
+    console.log(payload);
+
+    // setTimeout(() => {
+    //   try {
+    //     const fn = eval(payload.script + "\n\nmixin");
+    //     console.log(fn);
+
+    //     const result = fn(payload.params || {});
+    //     console.log("result", result);
+    //     emit(payload.callback, JSON.stringify(result)).catch(console.error);
+    //   } catch (err) {
+    //     console.error(err);
+    //   }
+    // }, 3000);
+  });
+}
diff --git a/src/services/types.ts b/src/services/types.ts
index b9e06f91e289fcddcd26a2987a37c7c95adb7826..d7d86d7cda32661648e07cb9f868121dbdb4220a 100644
--- a/src/services/types.ts
+++ b/src/services/types.ts
@@ -121,4 +121,15 @@ export namespace CmdType {
     enable_proxy_guard?: boolean;
     system_proxy_bypass?: string;
   }
+
+  export interface ChainItem {
+    item: ProfileItem;
+    merge?: object;
+    script?: string;
+  }
+
+  export interface EnhancedPayload {
+    chain: ChainItem[];
+    current: object;
+  }
 }