diff --git a/src-tauri/src/enhance/builtin/meta_guard.js b/src-tauri/src/enhance/builtin/meta_guard.js
new file mode 100644
index 0000000000000000000000000000000000000000..be4183bb2c65420213f6bf34915cfa91401816b6
--- /dev/null
+++ b/src-tauri/src/enhance/builtin/meta_guard.js
@@ -0,0 +1,6 @@
+function main(params) {
+  if (params.mode === "script") {
+    params.mode = "rule";
+  }
+  return params;
+}
diff --git a/src-tauri/src/enhance/builtin/hy_alpn.js b/src-tauri/src/enhance/builtin/meta_hy_alpn.js
similarity index 100%
rename from src-tauri/src/enhance/builtin/hy_alpn.js
rename to src-tauri/src/enhance/builtin/meta_hy_alpn.js
diff --git a/src-tauri/src/enhance/chain.rs b/src-tauri/src/enhance/chain.rs
index 1d65ba22a05f026a93359d2caa46c25004b76a9a..75c61fb8542e4e5c99413c4121cdcbf8335499c9 100644
--- a/src-tauri/src/enhance/chain.rs
+++ b/src-tauri/src/enhance/chain.rs
@@ -17,6 +17,13 @@ pub enum ChainType {
     Script(String),
 }
 
+#[derive(Debug, Clone)]
+pub enum ChainSupport {
+    Clash,
+    ClashMeta,
+    All,
+}
+
 impl From<&PrfItem> for Option<ChainItem> {
     fn from(item: &PrfItem) -> Self {
         let itype = item.itype.as_ref()?.as_str();
@@ -44,13 +51,39 @@ impl From<&PrfItem> for Option<ChainItem> {
 
 impl ChainItem {
     /// 内建支持一些脚本
-    pub fn builtin() -> Vec<ChainItem> {
+    pub fn builtin() -> Vec<(ChainSupport, ChainItem)> {
+        // meta 的一些处理
+        let meta_guard =
+            ChainItem::to_script("verge_meta_guard", include_str!("./builtin/meta_guard.js"));
+
         // meta 1.13.2 alpn string 转 数组
-        let hy_alpn = ChainItem {
-            uid: "verge_hy_alpn".into(),
-            data: ChainType::Script(include_str!("./builtin/hy_alpn.js").into()),
-        };
+        let hy_alpn =
+            ChainItem::to_script("verge_hy_alpn", include_str!("./builtin/meta_hy_alpn.js"));
+
+        vec![
+            (ChainSupport::ClashMeta, hy_alpn),
+            (ChainSupport::ClashMeta, meta_guard),
+        ]
+    }
 
-        vec![hy_alpn]
+    pub fn to_script<U: Into<String>, D: Into<String>>(uid: U, data: D) -> Self {
+        Self {
+            uid: uid.into(),
+            data: ChainType::Script(data.into()),
+        }
+    }
+}
+
+impl ChainSupport {
+    pub fn is_support(&self, core: Option<&String>) -> bool {
+        match core {
+            Some(core) => match (self, core.as_str()) {
+                (ChainSupport::All, _) => true,
+                (ChainSupport::Clash, "clash") => true,
+                (ChainSupport::ClashMeta, "clash-meta") => true,
+                _ => false,
+            },
+            None => true,
+        }
     }
 }
diff --git a/src-tauri/src/enhance/mod.rs b/src-tauri/src/enhance/mod.rs
index 4cf9231b486ad5729677b3b0feed2969435d42df..8c27a8f534b14dad32bccbfb8ee9497ed76bb32d 100644
--- a/src-tauri/src/enhance/mod.rs
+++ b/src-tauri/src/enhance/mod.rs
@@ -4,8 +4,9 @@ mod merge;
 mod script;
 mod tun;
 
-use self::chain::*;
 pub(self) use self::field::*;
+
+use self::chain::*;
 use self::merge::*;
 use self::script::*;
 use self::tun::*;
@@ -19,21 +20,21 @@ type ResultLog = Vec<(String, String)>;
 /// Enhance mode
 /// 返回最终配置、该配置包含的键、和script执行的结果
 pub fn enhance() -> (Mapping, Vec<String>, HashMap<String, ResultLog>) {
+    // config.yaml 的配置
     let clash_config = { Config::clash().latest().0.clone() };
 
-    let (tun_mode, enable_builtin) = {
+    let (clash_core, tun_mode, enable_builtin) = {
         let verge = Config::verge();
         let verge = verge.latest();
         (
+            verge.clash_core.clone(),
             verge.enable_tun_mode.clone(),
             verge.enable_builtin_enhanced.clone(),
         )
     };
 
-    let tun_mode = tun_mode.unwrap_or(false);
-    let enable_builtin = enable_builtin.unwrap_or(true);
-
-    let (mut config, mut chain, valid) = {
+    // 从profiles里拿东西
+    let (mut config, chain, valid) = {
         let profiles = Config::profiles();
         let profiles = profiles.latest();
 
@@ -53,15 +54,13 @@ pub fn enhance() -> (Mapping, Vec<String>, HashMap<String, ResultLog>) {
         (current, chain, valid)
     };
 
-    let mut result_map = HashMap::new();
-    let mut exists_keys = use_keys(&config);
+    let mut result_map = HashMap::new(); // 保存脚本日志
+    let mut exists_keys = use_keys(&config); // 保存出现过的keys
 
     let valid = use_valid_fields(valid);
+    config = use_filter(config, &valid);
 
-    if enable_builtin {
-        chain.extend(ChainItem::builtin().into_iter());
-    }
-
+    // 处理用户的profile
     chain.into_iter().for_each(|item| match item.data {
         ChainType::Merge(merge) => {
             exists_keys.extend(use_keys(&merge));
@@ -84,15 +83,38 @@ pub fn enhance() -> (Mapping, Vec<String>, HashMap<String, ResultLog>) {
         }
     });
 
-    config = use_filter(config, &valid);
-
+    // 合并默认的config
     for (key, value) in clash_config.into_iter() {
         config.insert(key, value);
     }
 
     let clash_fields = use_clash_fields();
+
+    // 内建脚本最后跑
+    if enable_builtin.unwrap_or(true) {
+        ChainItem::builtin()
+            .into_iter()
+            .filter(|(s, _)| s.is_support(clash_core.as_ref()))
+            .map(|(_, c)| c)
+            .for_each(|item| {
+                log::debug!(target: "app", "run builtin script {}", item.uid);
+
+                match item.data {
+                    ChainType::Script(script) => match use_script(script, config.to_owned()) {
+                        Ok((res_config, _)) => {
+                            config = use_filter(res_config, &clash_fields);
+                        }
+                        Err(err) => {
+                            log::error!(target: "app", "builtin script error `{err}`");
+                        }
+                    },
+                    _ => {}
+                }
+            });
+    }
+
     config = use_filter(config, &clash_fields);
-    config = use_tun(config, tun_mode);
+    config = use_tun(config, tun_mode.unwrap_or(false));
     config = use_sort(config);
 
     let mut exists_set = HashSet::new();