Alien před 12 roky
rodič
revize
c3f1528527

+ 1 - 1
chrome/manifest.json

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

+ 1 - 1
chrome/online.manifest.json

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

+ 5 - 0
chrome/static/css/fe-jsonformat.css

@@ -49,6 +49,11 @@ html {
 	background:url(../img/baidufe_bj.gif);
 	font-size: 14px;
 	color:#333;
+    direction: ltr;
+}
+html body {
+    background: inherit;
+    direction: inherit;
 }
 .mod-json {
 	width:980px;

+ 8 - 0
chrome/static/js/jsonformat/contentscript-jsonformat.js

@@ -56,6 +56,14 @@ baidu.csJsonFormat = (function(){
                 jsonObj = new Function("return " + jsonObj)();
             }
         }catch(ex){
+            // 如果body的内容还包含HTML标签,肯定不是合法的json了
+            var nodes = document.body.childNodes;
+            for(var i = 0,len = nodes.length;i < len;i++) {
+                if(nodes.nodeType != Node.TEXT_NODE) {
+                    return;
+                }
+            }
+
             // 再看看是不是jsonp的格式
             var reg=/^([\w\.]+)\(\s*([\s\S]*)\s*\)$/igm;
             var matches = reg.exec(source);