Sfoglia il codice sorgente

json格式化优化

zxlie 9 anni fa
parent
commit
555670a759

+ 1 - 1
chrome/manifest.json

@@ -1,6 +1,6 @@
 {
     "name": "WEB前端助手(FeHelper)",
-    "version": "8.8",
+    "version": "8.9",
     "manifest_version": 2,
 
     "default_locale": "zh_CN",

+ 1 - 1
chrome/online.manifest.json

@@ -1,6 +1,6 @@
 {
     "name": "WEB前端助手(FeHelper)",
-    "version": "8.8",
+    "version": "8.9",
     "manifest_version": 2,
 
     "default_locale": "zh_CN",

+ 2 - 2
chrome/static/js/jsonformat/contentscript-jsonformat.js

@@ -145,8 +145,8 @@ baidu.csJsonFormat = (function () {
                 // 直接replace掉所有\w之外的字符,再和原内容比较
                 var r_ns = newSource.replace(/[^\w]/gm,'').length;
                 var r_os = _uniDecode(source).replace(/[^\w]/gm,'').length;
-                // 允许内容产生1%的误差
-                if(Math.abs(r_ns - r_os) > (r_ns + r_os) / 200) {
+                // 允许内容产生1/20的误差
+                if(Math.abs(r_ns - r_os) > (r_ns + r_os) / 20) {
                     return ;
                 }
             } catch (ex) {