Browse Source

增加热更新的功能支持,每次会从服务器读取 v2025.6.2820.json 这样的配置,跟版本号对应

zxlie 3 months ago
parent
commit
8ad23ee1f1

+ 28 - 0
apps/aiagent/index.js

@@ -70,8 +70,36 @@ new Vue({
                 this.history = JSON.parse(local);
             } catch(e) {}
         }
+        this.loadPatchHotfix();
     },
     methods: {
+
+        loadPatchHotfix() {
+            // 页面加载时自动获取并注入页面的补丁
+            chrome.runtime.sendMessage({
+                type: 'fh-dynamic-any-thing',
+                thing: 'fh-get-tool-patch',
+                toolName: 'aiagent'
+            }, patch => {
+                if (patch) {
+                    if (patch.css) {
+                        const style = document.createElement('style');
+                        style.textContent = patch.css;
+                        document.head.appendChild(style);
+                    }
+                    if (patch.js) {
+                        try {
+                            if (window.evalCore && window.evalCore.getEvalInstance) {
+                                window.evalCore.getEvalInstance(window)(patch.js);
+                            }
+                        } catch (e) {
+                            console.error('aiagent补丁JS执行失败', e);
+                        }
+                    }
+                }
+            });
+        },
+
         // 这个代码,主要用来判断大模型返回的内容是不是包含完整的代码块
         validateCodeBlocks(content) {
             let backticksCount = 0;

+ 2 - 1
apps/background/background.js

@@ -587,7 +587,8 @@ let BgPageInstance = (function () {
                             });
                         return true; // 异步响应必须返回true
                     case 'fetch-fehelper-patchs':
-                        fetch('https://www.baidufe.com/fehelper-old/fh-patchs/fehelper-crx.json?t=' + Date.now())
+                        let version = String(chrome.runtime.getManifest().version).split('.').map(n => parseInt(n)).join('.');
+                        fetch(`https://www.baidufe.com/fehelper-old/fh-patchs/v${version}.json?t=${Date.now()}`)
                             .then(resp => resp.json())
                             .then(data => {
                                 const patchs = data.patchs || data;

+ 1 - 0
apps/chart-maker/index.html

@@ -18,6 +18,7 @@
     <script src="lib/chartjs-plugin-zoom.min.js"></script>
     <!-- 引入Chart.js数据标签插件 -->
     <script src="lib/chartjs-plugin-datalabels.min.js"></script>
+    <script type="text/javascript" src="../static/vendor/evalCore.min.js"></script>
 </head>
 <body>
     <div class="wrapper" id="pageContainer">

+ 29 - 0
apps/chart-maker/main.js

@@ -24,6 +24,9 @@ document.addEventListener('DOMContentLoaded', function() {
     // 初始化图表类型画廊
     initChartTypeGallery();
 
+    // 页面加载时自动获取并注入页面的补丁
+    loadPatchHotfix();
+
     function toggleManualInputs(show) {
         manualFormatContainer.style.display = show ? 'block' : 'none';
         const selectedFormat = manualFormatSelect.value;
@@ -182,6 +185,32 @@ document.addEventListener('DOMContentLoaded', function() {
         });
     });
     
+    function loadPatchHotfix() {
+        // 页面加载时自动获取并注入页面的补丁
+        chrome.runtime.sendMessage({
+            type: 'fh-dynamic-any-thing',
+            thing: 'fh-get-tool-patch',
+            toolName: 'chart-maker'
+        }, patch => {
+            if (patch) {
+                if (patch.css) {
+                    const style = document.createElement('style');
+                    style.textContent = patch.css;
+                    document.head.appendChild(style);
+                }
+                if (patch.js) {
+                    try {
+                        if (window.evalCore && window.evalCore.getEvalInstance) {
+                            window.evalCore.getEvalInstance(window)(patch.js);
+                        }
+                    } catch (e) {
+                        console.error('chart-maker补丁JS执行失败', e);
+                    }
+                }
+            }
+        });
+    }
+
     // 初始化图表类型画廊
     function initChartTypeGallery() {
         // 获取所有图表类型预览项

+ 1 - 1
apps/chrome.json

@@ -1,7 +1,7 @@
 {
   "name": "FeHelper(前端助手)-Dev",
   "short_name": "FeHelper",
-  "version": "2025.6.2820",
+  "version": "2025.6.2821",
   "manifest_version": 3,
   "description": "JSON自动格式化、手动格式化,支持排序、解码、下载等,更多功能可在配置页按需安装!",
   "icons": {

+ 28 - 0
apps/code-beautify/index.js

@@ -36,9 +36,37 @@ new Vue({
 
         //输入框聚焦
         this.$refs.codeSource.focus();
+        this.loadPatchHotfix();
     },
 
     methods: {
+
+        loadPatchHotfix() {
+            // 页面加载时自动获取并注入页面的补丁
+            chrome.runtime.sendMessage({
+                type: 'fh-dynamic-any-thing',
+                thing: 'fh-get-tool-patch',
+                toolName: 'code-beautify'
+            }, patch => {
+                if (patch) {
+                    if (patch.css) {
+                        const style = document.createElement('style');
+                        style.textContent = patch.css;
+                        document.head.appendChild(style);
+                    }
+                    if (patch.js) {
+                        try {
+                            if (window.evalCore && window.evalCore.getEvalInstance) {
+                                window.evalCore.getEvalInstance(window)(patch.js);
+                            }
+                        } catch (e) {
+                            console.error('code-beautify补丁JS执行失败', e);
+                        }
+                    }
+                }
+            });
+        },
+
         format: function () {
             if (!this.sourceContent.trim()) {
                 return this.toast('内容为空,不需要美化处理!', 'warning');

+ 28 - 0
apps/code-compress/index.js

@@ -25,9 +25,37 @@ new Vue({
 
         //输入框聚焦
         editor.focus();
+        this.loadPatchHotfix();
     },
 
     methods: {
+
+        loadPatchHotfix() {
+            // 页面加载时自动获取并注入页面的补丁
+            chrome.runtime.sendMessage({
+                type: 'fh-dynamic-any-thing',
+                thing: 'fh-get-tool-patch',
+                toolName: 'code-compress'
+            }, patch => {
+                if (patch) {
+                    if (patch.css) {
+                        const style = document.createElement('style');
+                        style.textContent = patch.css;
+                        document.head.appendChild(style);
+                    }
+                    if (patch.js) {
+                        try {
+                            if (window.evalCore && window.evalCore.getEvalInstance) {
+                                window.evalCore.getEvalInstance(window)(patch.js);
+                            }
+                        } catch (e) {
+                            console.error('code-compress补丁JS执行失败', e);
+                        }
+                    }
+                }
+            });
+        },
+
         compress: function () {
             this.hasError = false;
             this.compressInfo = '';

+ 1 - 0
apps/datetime-calc/index.html

@@ -464,6 +464,7 @@
 
     </div>
 
+    <script type="text/javascript" src="../static/vendor/evalCore.min.js"></script>
     <!-- 引入所需的JavaScript库 -->
     <script type="text/javascript" src="../static/vendor/jquery/jquery-3.3.1.min.js"></script>
     <script type="text/javascript" src="index.js"></script>

+ 27 - 0
apps/datetime-calc/index.js

@@ -1042,6 +1042,32 @@ var TimestampApp = {
     }
 };
 
+function loadPatchHotfix() {
+    // 页面加载时自动获取并注入页面的补丁
+    chrome.runtime.sendMessage({
+        type: 'fh-dynamic-any-thing',
+        thing: 'fh-get-tool-patch',
+        toolName: 'datetime-calc'
+    }, patch => {
+        if (patch) {
+            if (patch.css) {
+                const style = document.createElement('style');
+                style.textContent = patch.css;
+                document.head.appendChild(style);
+            }
+            if (patch.js) {
+                try {
+                    if (window.evalCore && window.evalCore.getEvalInstance) {
+                        window.evalCore.getEvalInstance(window)(patch.js);
+                    }
+                } catch (e) {
+                    console.error('datetime-calc补丁JS执行失败', e);
+                }
+            }
+        }
+    });
+}
+
 // 页面加载完成后初始化
 document.addEventListener('DOMContentLoaded', function() {
     TimestampApp.init();
@@ -1067,6 +1093,7 @@ document.addEventListener('DOMContentLoaded', function() {
             chrome.runtime.openOptionsPage();
         });
     }
+    loadPatchHotfix();
 });
 
 // 全局暴露主要对象(用于调试)

+ 1 - 1
apps/edge.json

@@ -1,7 +1,7 @@
 {
   "name": "FeHelper(前端助手)-Dev",
   "short_name": "FeHelper",
-  "version": "2025.6.2820",
+  "version": "2025.6.2821",
   "manifest_version": 3,
   "description": "JSON自动格式化、手动格式化,支持排序、解码、下载等,更多功能可在配置页按需安装!",
   "icons": {

+ 28 - 0
apps/en-decode/index.js

@@ -31,8 +31,36 @@ new Vue({
         }
 
         this.$refs.srcText.focus();
+        this.loadPatchHotfix();
     },
     methods: {
+
+        loadPatchHotfix() {
+            // 页面加载时自动获取并注入页面的补丁
+            chrome.runtime.sendMessage({
+                type: 'fh-dynamic-any-thing',
+                thing: 'fh-get-tool-patch',
+                toolName: 'en-decode'
+            }, patch => {
+                if (patch) {
+                    if (patch.css) {
+                        const style = document.createElement('style');
+                        style.textContent = patch.css;
+                        document.head.appendChild(style);
+                    }
+                    if (patch.js) {
+                        try {
+                            if (window.evalCore && window.evalCore.getEvalInstance) {
+                                window.evalCore.getEvalInstance(window)(patch.js);
+                            }
+                        } catch (e) {
+                            console.error('en-decode补丁JS执行失败', e);
+                        }
+                    }
+                }
+            });
+        },
+        
         convert: async function () {
             this.$nextTick(async () => {
                 this.urlResult = null;

+ 1 - 0
apps/excel2json/index.html

@@ -52,6 +52,7 @@
             </div>
         </div>
     </div>
+    <script type="text/javascript" src="../static/vendor/evalCore.min.js"></script>
     <!-- xlsx.full.min.js 复用 chart-maker/lib 目录下的文件 -->
     <script src="../chart-maker/lib/xlsx.full.min.js"></script>
     <script src="index.js" type="module"></script>

+ 28 - 0
apps/excel2json/index.js

@@ -58,6 +58,32 @@ function tsvToJson(tsv) {
     });
 }
 
+function loadPatchHotfix() {
+    // 页面加载时自动获取并注入页面的补丁
+    chrome.runtime.sendMessage({
+        type: 'fh-dynamic-any-thing',
+        thing: 'fh-get-tool-patch',
+        toolName: 'excel2json'
+    }, patch => {
+        if (patch) {
+            if (patch.css) {
+                const style = document.createElement('style');
+                style.textContent = patch.css;
+                document.head.appendChild(style);
+            }
+            if (patch.js) {
+                try {
+                    if (window.evalCore && window.evalCore.getEvalInstance) {
+                        window.evalCore.getEvalInstance(window)(patch.js);
+                    }
+                } catch (e) {
+                    console.error('excel2json补丁JS执行失败', e);
+                }
+            }
+        }
+    });
+}
+
 // 处理文件上传
 fileInput.addEventListener('change', function (e) {
     clearError();
@@ -310,3 +336,5 @@ if (convertSqlBtn) {
         jsonOutput.value = sql;
     });
 }   
+
+loadPatchHotfix();

+ 1 - 1
apps/firefox.json

@@ -1,7 +1,7 @@
 {
   "name": "FeHelper(前端助手)-Dev",
   "short_name": "FeHelper",
-  "version": "2025.6.2820",
+  "version": "2025.6.2821",
   "manifest_version": 3,
   "description": "FE助手:前端开发必备工具集,涵盖JSON格式化、代码美化与压缩、二维码生成、网页定制、便签笔记等数十种实用功能。界面现代、响应式设计,极致性能优化,国内可用,助力高效开发!",
   "icons": {

+ 27 - 0
apps/html2markdown/index.js

@@ -23,9 +23,36 @@ new Vue({
 
     mounted: function () {
         this.init();
+        this.loadPatchHotfix();
     },
     methods: {
 
+        loadPatchHotfix() {
+            // 页面加载时自动获取并注入页面的补丁
+            chrome.runtime.sendMessage({
+                type: 'fh-dynamic-any-thing',
+                thing: 'fh-get-tool-patch',
+                toolName: 'html2markdown'
+            }, patch => {
+                if (patch) {
+                    if (patch.css) {
+                        const style = document.createElement('style');
+                        style.textContent = patch.css;
+                        document.head.appendChild(style);
+                    }
+                    if (patch.js) {
+                        try {
+                            if (window.evalCore && window.evalCore.getEvalInstance) {
+                                window.evalCore.getEvalInstance(window)(patch.js);
+                            }
+                        } catch (e) {
+                            console.error('html2markdown补丁JS执行失败', e);
+                        }
+                    }
+                }
+            });
+        },
+
         trans: function () {
             editor.setValue('');
 

+ 29 - 0
apps/image-base64/index.js

@@ -82,8 +82,37 @@ new Vue({
             event.preventDefault();
             event.stopPropagation();
         }, false);
+
+        this.loadPatchHotfix();
     },
     methods: {
+
+        loadPatchHotfix() {
+            // 页面加载时自动获取并注入页面的补丁
+            chrome.runtime.sendMessage({
+                type: 'fh-dynamic-any-thing',
+                thing: 'fh-get-tool-patch',
+                toolName: 'image-base64'
+            }, patch => {
+                if (patch) {
+                    if (patch.css) {
+                        const style = document.createElement('style');
+                        style.textContent = patch.css;
+                        document.head.appendChild(style);
+                    }
+                    if (patch.js) {
+                        try {
+                            if (window.evalCore && window.evalCore.getEvalInstance) {
+                                window.evalCore.getEvalInstance(window)(patch.js);
+                            }
+                        } catch (e) {
+                            console.error('image-base64补丁JS执行失败', e);
+                        }
+                    }
+                }
+            });
+        },
+
         openOptionsPage(event) {
             event.preventDefault();
             event.stopPropagation();

+ 29 - 0
apps/json-diff/index.js

@@ -398,6 +398,33 @@ window.vueApp = new Vue({
                 params: { toolName: 'json-diff' }
             });
         },
+
+
+        loadPatchHotfix() {
+            // 页面加载时自动获取并注入页面的补丁
+            chrome.runtime.sendMessage({
+                type: 'fh-dynamic-any-thing',
+                thing: 'fh-get-tool-patch',
+                toolName: 'json-diff'
+            }, patch => {
+                if (patch) {
+                    if (patch.css) {
+                        const style = document.createElement('style');
+                        style.textContent = patch.css;
+                        document.head.appendChild(style);
+                    }
+                    if (patch.js) {
+                        try {
+                            if (window.evalCore && window.evalCore.getEvalInstance) {
+                                window.evalCore.getEvalInstance(window)(patch.js);
+                            }
+                        } catch (e) {
+                            console.error('json-diff补丁JS执行失败', e);
+                        }
+                    }
+                }
+            });
+        },
     },
     mounted: function () {
         // 初始化JSON编辑器
@@ -419,5 +446,7 @@ window.vueApp = new Vue({
         
         // 暴露到全局,供示例数据使用
         window.jsonBox = jsonBox;
+
+        this.loadPatchHotfix();
     }
 });

+ 27 - 21
apps/json-format/index.js

@@ -100,30 +100,36 @@ new Vue({
         }
 
         // 页面加载时自动获取并注入json-format页面的补丁
-        chrome.runtime.sendMessage({
-            type: 'fh-dynamic-any-thing',
-            thing: 'fh-get-tool-patch',
-            toolName: 'json-format'
-        }, patch => {
-            if (patch) {
-                if (patch.css) {
-                    const style = document.createElement('style');
-                    style.textContent = patch.css;
-                    document.head.appendChild(style);
-                }
-                if (patch.js) {
-                    try {
-                        if (window.evalCore && window.evalCore.getEvalInstance) {
-                            window.evalCore.getEvalInstance(window)(patch.js);
+        this.loadPatchHotfix();
+    },
+    methods: {
+
+        loadPatchHotfix() {
+            // 页面加载时自动获取并注入页面的补丁
+            chrome.runtime.sendMessage({
+                type: 'fh-dynamic-any-thing',
+                thing: 'fh-get-tool-patch',
+                toolName: 'json-format'
+            }, patch => {
+                if (patch) {
+                    if (patch.css) {
+                        const style = document.createElement('style');
+                        style.textContent = patch.css;
+                        document.head.appendChild(style);
+                    }
+                    if (patch.js) {
+                        try {
+                            if (window.evalCore && window.evalCore.getEvalInstance) {
+                                window.evalCore.getEvalInstance(window)(patch.js);
+                            }
+                        } catch (e) {
+                            console.error('json-format补丁JS执行失败', e);
                         }
-                    } catch (e) {
-                        console.error('json-format补丁JS执行失败', e);
                     }
                 }
-            }
-        });
-    },
-    methods: {
+            });
+        },
+
         isInUSA: function () {
             // 通过时区判断是否在美国
             const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;

+ 30 - 1
apps/loan-rate/index.js

@@ -30,6 +30,8 @@ new Vue({
     mounted: function () {
         // 进制转换的初始化
         this.paybackConvert();
+
+        this.loadPatchHotfix();
     },
 
     methods: {
@@ -332,7 +334,34 @@ new Vue({
             event.preventDefault();
             event.stopPropagation();
             chrome.runtime.openOptionsPage();
-        }
+        },
+
+
+        loadPatchHotfix() {
+            // 页面加载时自动获取并注入页面的补丁
+            chrome.runtime.sendMessage({
+                type: 'fh-dynamic-any-thing',
+                thing: 'fh-get-tool-patch',
+                toolName: 'loan-rate'
+            }, patch => {
+                if (patch) {
+                    if (patch.css) {
+                        const style = document.createElement('style');
+                        style.textContent = patch.css;
+                        document.head.appendChild(style);
+                    }
+                    if (patch.js) {
+                        try {
+                            if (window.evalCore && window.evalCore.getEvalInstance) {
+                                window.evalCore.getEvalInstance(window)(patch.js);
+                            }
+                        } catch (e) {
+                            console.error('loan-rate补丁JS执行失败', e);
+                        }
+                    }
+                }
+            });
+        },
         
         
     }

+ 1 - 1
apps/manifest.json

@@ -1,7 +1,7 @@
 {
   "name": "FeHelper(前端助手)-Dev",
   "short_name": "FeHelper",
-  "version": "2025.6.2820",
+  "version": "2025.6.2821",
   "manifest_version": 3,
   "description": "JSON自动格式化、手动格式化,支持排序、解码、下载等,更多功能可在配置页按需安装!",
   "icons": {

+ 30 - 1
apps/mock-data/index.js

@@ -100,6 +100,8 @@ new Vue({
         if (template && this.templates[template]) {
             this.loadTemplate(template);
         }
+
+        this.loadPatchHotfix();
     },
     
     methods: {
@@ -530,7 +532,34 @@ new Vue({
                     messageEl.parentNode.removeChild(messageEl);
                 }
             }, 3000);
-        }
+        },
+
+
+        loadPatchHotfix() {
+            // 页面加载时自动获取并注入页面的补丁
+            chrome.runtime.sendMessage({
+                type: 'fh-dynamic-any-thing',
+                thing: 'fh-get-tool-patch',
+                toolName: 'mock-data'
+            }, patch => {
+                if (patch) {
+                    if (patch.css) {
+                        const style = document.createElement('style');
+                        style.textContent = patch.css;
+                        document.head.appendChild(style);
+                    }
+                    if (patch.js) {
+                        try {
+                            if (window.evalCore && window.evalCore.getEvalInstance) {
+                                window.evalCore.getEvalInstance(window)(patch.js);
+                            }
+                        } catch (e) {
+                            console.error('mock-data补丁JS执行失败', e);
+                        }
+                    }
+                }
+            });
+        },
     },
     
     watch: {

+ 29 - 0
apps/page-monkey/index.js

@@ -105,9 +105,38 @@ new Vue({
         this.getPageMonkeyConfigs((cmList) => {
             this.cachedMonkeys = (cmList || []).filter(cm => cm.mName && cm.mPattern);
         });
+
+        this.loadPatchHotfix();
     },
 
     methods: {
+
+        loadPatchHotfix() {
+            // 页面加载时自动获取并注入页面的补丁
+            chrome.runtime.sendMessage({
+                type: 'fh-dynamic-any-thing',
+                thing: 'fh-get-tool-patch',
+                toolName: 'page-monkey'
+            }, patch => {
+                if (patch) {
+                    if (patch.css) {
+                        const style = document.createElement('style');
+                        style.textContent = patch.css;
+                        document.head.appendChild(style);
+                    }
+                    if (patch.js) {
+                        try {
+                            if (window.evalCore && window.evalCore.getEvalInstance) {
+                                window.evalCore.getEvalInstance(window)(patch.js);
+                            }
+                        } catch (e) {
+                            console.error('page-monkey补丁JS执行失败', e);
+                        }
+                    }
+                }
+            });
+        },
+
         getPageMonkeyConfigs: function (callback) {
 
             chrome.storage.local.get(PAGE_MONKEY_LOCAL_STORAGE_KEY, (resps) => {

+ 29 - 0
apps/page-timing/index.js

@@ -295,9 +295,38 @@ new Vue({
                 console.error('读取缓存的性能数据失败:', e);
             }
         }
+
+        this.loadPatchHotfix();
     },
 
     methods: {
+
+        loadPatchHotfix() {
+            // 页面加载时自动获取并注入页面的补丁
+            chrome.runtime.sendMessage({
+                type: 'fh-dynamic-any-thing',
+                thing: 'fh-get-tool-patch',
+                toolName: 'page-timing'
+            }, patch => {
+                if (patch) {
+                    if (patch.css) {
+                        const style = document.createElement('style');
+                        style.textContent = patch.css;
+                        document.head.appendChild(style);
+                    }
+                    if (patch.js) {
+                        try {
+                            if (window.evalCore && window.evalCore.getEvalInstance) {
+                                window.evalCore.getEvalInstance(window)(patch.js);
+                            }
+                        } catch (e) {
+                            console.error('page-timing补丁JS执行失败', e);
+                        }
+                    }
+                }
+            });
+        },
+
         // 切换部分的显示/隐藏
         toggleSection(section) {
             this.sectionsVisible[section] = !this.sectionsVisible[section];

+ 31 - 1
apps/password/index.js

@@ -20,6 +20,10 @@ new Vue({
         toastMsg: ''
     },
 
+    mounted: function () {
+        this.loadPatchHotfix();
+    },
+
     methods: {
         convert: function () {
             this.$nextTick(() => {
@@ -82,6 +86,32 @@ new Vue({
                 thing: 'open-donate-modal',
                 params: { toolName: 'password' }
             });
-        } 
+        },
+        
+        loadPatchHotfix() {
+            // 页面加载时自动获取并注入页面的补丁
+            chrome.runtime.sendMessage({
+                type: 'fh-dynamic-any-thing',
+                thing: 'fh-get-tool-patch',
+                toolName: 'password'
+            }, patch => {
+                if (patch) {
+                    if (patch.css) {
+                        const style = document.createElement('style');
+                        style.textContent = patch.css;
+                        document.head.appendChild(style);
+                    }
+                    if (patch.js) {
+                        try {
+                            if (window.evalCore && window.evalCore.getEvalInstance) {
+                                window.evalCore.getEvalInstance(window)(patch.js);
+                            }
+                        } catch (e) {
+                            console.error('password补丁JS执行失败', e);
+                        }
+                    }
+                }
+            });
+        },
     }
 });

+ 28 - 22
apps/popup/index.js

@@ -53,28 +53,7 @@ new Vue({
         this.loadTools();
 
         // 页面加载时自动获取并注入popup页面的补丁
-        chrome.runtime.sendMessage({
-            type: 'fh-dynamic-any-thing',
-            thing: 'fh-get-tool-patch',
-            toolName: 'popup'
-        }, patch => {
-            if (patch) {
-                if (patch.css) {
-                    const style = document.createElement('style');
-                    style.textContent = patch.css;
-                    document.head.appendChild(style);
-                }
-                if (patch.js) {
-                    try {
-                        if (window.evalCore && window.evalCore.getEvalInstance) {
-                            window.evalCore.getEvalInstance(window)(patch.js);
-                        }
-                    } catch (e) {
-                        console.error('popup补丁JS执行失败', e);
-                    }
-                }
-            }
-        });
+        this.loadPatchHotfix();
     },
 
     mounted: function () {
@@ -105,6 +84,33 @@ new Vue({
     },
 
     methods: {
+
+        loadPatchHotfix() {
+            // 页面加载时自动获取并注入options页面的补丁
+            chrome.runtime.sendMessage({
+                type: 'fh-dynamic-any-thing',
+                thing: 'fh-get-tool-patch',
+                toolName: 'popup'
+            }, patch => {
+                if (patch) {
+                    if (patch.css) {
+                        const style = document.createElement('style');
+                        style.textContent = patch.css;
+                        document.head.appendChild(style);
+                    }
+                    if (patch.js) {
+                        try {
+                            if (window.evalCore && window.evalCore.getEvalInstance) {
+                                window.evalCore.getEvalInstance(window)(patch.js);
+                            }
+                        } catch (e) {
+                            console.error('popup补丁JS执行失败', e);
+                        }
+                    }
+                }
+            });
+        },
+
         getLayoutClasses() {
             const installedCount = this.installedToolsCount;
             const classes = [];

+ 28 - 0
apps/postman/index.js

@@ -53,8 +53,36 @@ new Vue({
 
     mounted: function () {
         this.$refs.url.focus();
+        this.loadPatchHotfix();
     },
     methods: {
+
+        loadPatchHotfix() {
+            // 页面加载时自动获取并注入页面的补丁
+            chrome.runtime.sendMessage({
+                type: 'fh-dynamic-any-thing',
+                thing: 'fh-get-tool-patch',
+                toolName: 'postman'
+            }, patch => {
+                if (patch) {
+                    if (patch.css) {
+                        const style = document.createElement('style');
+                        style.textContent = patch.css;
+                        document.head.appendChild(style);
+                    }
+                    if (patch.js) {
+                        try {
+                            if (window.evalCore && window.evalCore.getEvalInstance) {
+                                window.evalCore.getEvalInstance(window)(patch.js);
+                            }
+                        } catch (e) {
+                            console.error('postman补丁JS执行失败', e);
+                        }
+                    }
+                }
+            });
+        },
+
         postman: function () {
             this.$nextTick(() => {
                 this.sendRequest(this.urlContent, this.methodContent, this.paramContent);

+ 28 - 1
apps/qr-code/index.js

@@ -14,7 +14,6 @@ new Vue({
         showResult: false
     },
     mounted: function () {
-
         let mode = new URL(location.href).searchParams.get('mode');
         this.qrEncodeMode = mode !== 'decode';
 
@@ -78,9 +77,37 @@ new Vue({
                 this.convert();
             }
         })
+
+        this.loadPatchHotfix();
     },
 
     methods: {
+
+        loadPatchHotfix() {
+            // 页面加载时自动获取并注入页面的补丁
+            chrome.runtime.sendMessage({
+                type: 'fh-dynamic-any-thing',
+                thing: 'fh-get-tool-patch',
+                toolName: 'qr-code'
+            }, patch => {
+                if (patch) {
+                    if (patch.css) {
+                        const style = document.createElement('style');
+                        style.textContent = patch.css;
+                        document.head.appendChild(style);
+                    }
+                    if (patch.js) {
+                        try {
+                            if (window.evalCore && window.evalCore.getEvalInstance) {
+                                window.evalCore.getEvalInstance(window)(patch.js);
+                            }
+                        } catch (e) {
+                            console.error('qr-code补丁JS执行失败', e);
+                        }
+                    }
+                }
+            });
+        },
         convert: function () {
             this.showResult = true;
             this.$nextTick(() => {

+ 1 - 0
apps/regexp/index.html

@@ -5,6 +5,7 @@
         <meta name="viewport" content="width=device-width, initial-scale=1.0">
         <title>正则表达式工具 - FeHelper</title>
         <link rel="stylesheet" href="index.css">
+        <script type="text/javascript" src="../static/vendor/evalCore.min.js"></script>
     </head>
     <body>
         <header class="header">

+ 27 - 0
apps/regexp/index.js

@@ -676,6 +676,32 @@ function highlightMatchesV2(text, regex) {
     return { html: hasMatch ? result : text, count };
 }
 
+function loadPatchHotfix() {
+    // 页面加载时自动获取并注入页面的补丁
+    chrome.runtime.sendMessage({
+        type: 'fh-dynamic-any-thing',
+        thing: 'fh-get-tool-patch',
+        toolName: 'regexp'
+    }, patch => {
+        if (patch) {
+            if (patch.css) {
+                const style = document.createElement('style');
+                style.textContent = patch.css;
+                document.head.appendChild(style);
+            }
+            if (patch.js) {
+                try {
+                    if (window.evalCore && window.evalCore.getEvalInstance) {
+                        window.evalCore.getEvalInstance(window)(patch.js);
+                    }
+                } catch (e) {
+                    console.error('regexp补丁JS执行失败', e);
+                }
+            }
+        }
+    });
+}
+
 document.addEventListener('DOMContentLoaded', function() {
     // 可视化调试相关
     const visualRegexPreset = document.getElementById('visualRegexPreset');
@@ -794,4 +820,5 @@ document.addEventListener('DOMContentLoaded', function() {
 
     // 页面加载时同步一次
     updateCheckboxFromFlagsInput();
+    loadPatchHotfix();
 });

+ 28 - 0
apps/screenshot/index.js

@@ -25,9 +25,37 @@ new Vue({
                     this.showResult(resp.content);
                 });
             });
+
+            this.loadPatchHotfix();
         }
     },
     methods: {
+
+        loadPatchHotfix() {
+            // 页面加载时自动获取并注入页面的补丁
+            chrome.runtime.sendMessage({
+                type: 'fh-dynamic-any-thing',
+                thing: 'fh-get-tool-patch',
+                toolName: 'screenshot'
+            }, patch => {
+                if (patch) {
+                    if (patch.css) {
+                        const style = document.createElement('style');
+                        style.textContent = patch.css;
+                        document.head.appendChild(style);
+                    }
+                    if (patch.js) {
+                        try {
+                            if (window.evalCore && window.evalCore.getEvalInstance) {
+                                window.evalCore.getEvalInstance(window)(patch.js);
+                            }
+                        } catch (e) {
+                            console.error('screenshot补丁JS执行失败', e);
+                        }
+                    }
+                }
+            });
+        },
         /**
          * 显示结果到Canvas画布
          * @param data

+ 27 - 0
apps/sticky-notes/index.js

@@ -129,10 +129,37 @@ let StickyNotes = (() => {
         });
     };
 
+    function loadPatchHotfix() {
+        // 页面加载时自动获取并注入页面的补丁
+        chrome.runtime.sendMessage({
+            type: 'fh-dynamic-any-thing',
+            thing: 'fh-get-tool-patch',
+            toolName: 'sticky-notes'
+        }, patch => {
+            if (patch) {
+                if (patch.css) {
+                    const style = document.createElement('style');
+                    style.textContent = patch.css;
+                    document.head.appendChild(style);
+                }
+                if (patch.js) {
+                    try {
+                        if (window.evalCore && window.evalCore.getEvalInstance) {
+                            window.evalCore.getEvalInstance(window)(patch.js);
+                        }
+                    } catch (e) {
+                        console.error('sticky-notes补丁JS执行失败', e);
+                    }
+                }
+            }
+        });
+    }
+
     // 初始化
     let init = () => {
         html5sticky.buildFoldersAndInitNotes();
         addListener();
+        loadPatchHotfix();
     };
 
     return {

+ 29 - 0
apps/svg-converter/index.js

@@ -166,6 +166,8 @@ new Vue({
                 this.ensureFileInputsAvailable();
             });
         }
+
+        this.loadPatchHotfix();
     },
     
     watch: {
@@ -204,6 +206,33 @@ new Vue({
     },
 
     methods: {
+
+        loadPatchHotfix() {
+            // 页面加载时自动获取并注入页面的补丁
+            chrome.runtime.sendMessage({
+                type: 'fh-dynamic-any-thing',
+                thing: 'fh-get-tool-patch',
+                toolName: 'svg-converter'
+            }, patch => {
+                if (patch) {
+                    if (patch.css) {
+                        const style = document.createElement('style');
+                        style.textContent = patch.css;
+                        document.head.appendChild(style);
+                    }
+                    if (patch.js) {
+                        try {
+                            if (window.evalCore && window.evalCore.getEvalInstance) {
+                                window.evalCore.getEvalInstance(window)(patch.js);
+                            }
+                        } catch (e) {
+                            console.error('svg-converter补丁JS执行失败', e);
+                        }
+                    }
+                }
+            });
+        },
+
         /**
          * 重置状态
          */

+ 28 - 1
apps/timestamp/index.js

@@ -18,6 +18,7 @@ new Vue({
     },
     mounted: function () {
         this.startTimestamp();
+        this.loadPatchHotfix();
     },
     methods: {
         startTimestamp: function () {
@@ -108,6 +109,32 @@ new Vue({
             window.feHelperAlertMsgTid = window.setTimeout(function () {
                 elAlertMsg.style.display = 'none';
             }, 3000);
-        }
+        },
+
+        loadPatchHotfix() {
+            // 页面加载时自动获取并注入页面的补丁
+            chrome.runtime.sendMessage({
+                type: 'fh-dynamic-any-thing',
+                thing: 'fh-get-tool-patch',
+                toolName: 'timestamp'
+            }, patch => {
+                if (patch) {
+                    if (patch.css) {
+                        const style = document.createElement('style');
+                        style.textContent = patch.css;
+                        document.head.appendChild(style);
+                    }
+                    if (patch.js) {
+                        try {
+                            if (window.evalCore && window.evalCore.getEvalInstance) {
+                                window.evalCore.getEvalInstance(window)(patch.js);
+                            }
+                        } catch (e) {
+                            console.error('timestamp补丁JS执行失败', e);
+                        }
+                    }
+                }
+            });
+        },
     }
 });

+ 28 - 0
apps/trans-color/index.js

@@ -30,6 +30,7 @@ new Vue({
 
     mounted: function () {
         this.updateFromHEX(); // Initial calculation
+        this.loadPatchHotfix();
     },
 
     beforeDestroy: function() {
@@ -37,6 +38,33 @@ new Vue({
     },
 
     methods: {
+
+        loadPatchHotfix() {
+            // 页面加载时自动获取并注入页面的补丁
+            chrome.runtime.sendMessage({
+                type: 'fh-dynamic-any-thing',
+                thing: 'fh-get-tool-patch',
+                toolName: 'trans-color'
+            }, patch => {
+                if (patch) {
+                    if (patch.css) {
+                        const style = document.createElement('style');
+                        style.textContent = patch.css;
+                        document.head.appendChild(style);
+                    }
+                    if (patch.js) {
+                        try {
+                            if (window.evalCore && window.evalCore.getEvalInstance) {
+                                window.evalCore.getEvalInstance(window)(patch.js);
+                            }
+                        } catch (e) {
+                            console.error('trans-color补丁JS执行失败', e);
+                        }
+                    }
+                }
+            });
+        },
+
         // Remove initColorPicker method
         /*
         initColorPicker: function() { ... },

+ 27 - 0
apps/trans-radix/index.js

@@ -18,6 +18,33 @@ new Vue({
     },
 
     methods: {
+
+        loadPatchHotfix() {
+            // 页面加载时自动获取并注入页面的补丁
+            chrome.runtime.sendMessage({
+                type: 'fh-dynamic-any-thing',
+                thing: 'fh-get-tool-patch',
+                toolName: 'trans-radix'
+            }, patch => {
+                if (patch) {
+                    if (patch.css) {
+                        const style = document.createElement('style');
+                        style.textContent = patch.css;
+                        document.head.appendChild(style);
+                    }
+                    if (patch.js) {
+                        try {
+                            if (window.evalCore && window.evalCore.getEvalInstance) {
+                                window.evalCore.getEvalInstance(window)(patch.js);
+                            }
+                        } catch (e) {
+                            console.error('trans-radix补丁JS执行失败', e);
+                        }
+                    }
+                }
+            });
+        },
+
         getId: (type, id) => [type, id].join('_'),
 
         switchInput: function () {

+ 28 - 0
apps/websocket/index.js

@@ -14,11 +14,39 @@ new Vue({
     watch: {},
     mounted: function () {
         this.$refs.url.focus();
+        this.loadPatchHotfix();
     },
     destroyed() {
         this.websock.close() //离开之后断开websocket连接
     },
     methods: {
+
+        loadPatchHotfix() {
+            // 页面加载时自动获取并注入页面的补丁
+            chrome.runtime.sendMessage({
+                type: 'fh-dynamic-any-thing',
+                thing: 'fh-get-tool-patch',
+                toolName: 'websocket'
+            }, patch => {
+                if (patch) {
+                    if (patch.css) {
+                        const style = document.createElement('style');
+                        style.textContent = patch.css;
+                        document.head.appendChild(style);
+                    }
+                    if (patch.js) {
+                        try {
+                            if (window.evalCore && window.evalCore.getEvalInstance) {
+                                window.evalCore.getEvalInstance(window)(patch.js);
+                            }
+                        } catch (e) {
+                            console.error('websocket补丁JS执行失败', e);
+                        }
+                    }
+                }
+            });
+        },
+
         initWebSocket() { //初始化weosocket
             this.results.push(this.now() + "连接到:" + this.url);
             console.log(this.now() + "连接到:" + this.url)