From 48b34bf95f239271e748fbe88f20844390d52886 Mon Sep 17 00:00:00 2001 From: Gabe Yuan Date: Fri, 19 Jan 2024 16:13:46 +0800 Subject: [PATCH] fix: save new rule with hostname --- src/views/Popup/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/Popup/index.js b/src/views/Popup/index.js index 0e2fad1..296dcce 100644 --- a/src/views/Popup/index.js +++ b/src/views/Popup/index.js @@ -84,7 +84,7 @@ export default function Popup({ setShowPopup, translator: tran }) { const tab = await getTabInfo(); href = tab.url; } - const newRule = { ...rule, pattern: href }; + const newRule = { ...rule, pattern: href.split("/")[2] }; if (isExt && tran) { sendBgMsg(MSG_SAVE_RULE, newRule); } else {