diff --git a/README.md b/README.md
index bddce25..c75b366 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,7 @@ Features
* You can inspect the JSON by typing `djson` in the console
* Counts items and properties in a collection
* Show JSON path of the elements on hover and copy it with the context menu
-* Option to start with JSON collapsed
+* Option to start with JSON collapsed (always or if the file is big)
* Recognize nested JSON strings in properties value
A background worker is used to prevent the UI freezing when processing very long JSON pages.
diff --git a/djson-viewer.crx b/djson-viewer.crx
index 6c5b390..430eb4e 100644
Binary files a/djson-viewer.crx and b/djson-viewer.crx differ
diff --git a/extension/changelog.html b/extension/changelog.html
index a7713ef..4116700 100644
--- a/extension/changelog.html
+++ b/extension/changelog.html
@@ -8,7 +8,13 @@
DJSON - ChangeLog
We just updated the extension... check out what's new!!!
-
v0.4.3 (latest) - 05/06/2017
+
v0.4.4 (latest) - 24/06/2017
+
+
Option to start with collapsed JSON if the file is big (>1MB)
+
Fixed slashed encoding in recognized nested JSON strings in properties value
+
Collapse All button will start from the first tree level
+
+
v0.4.3 - 05/06/2017
Simplified the view json flow. Now it will always open a new tab
Recognize nested JSON strings in properties value
diff --git a/extension/js/background.js b/extension/js/background.js
index b981cfc..2f9e0aa 100644
--- a/extension/js/background.js
+++ b/extension/js/background.js
@@ -562,7 +562,6 @@
prop = prop.substring(1);
}
var result = Object.byString(msg.obj, prop);
- result = result.replace(/\\(.)/mg, "$1");
openJsonTab(result);
}
@@ -647,6 +646,7 @@
port.postMessage(['FORMATTING', JSON.stringify(localStorage)]);
// Do formatting
+ var startCollapsed = localStorage.getItem('startCollapsed') || (localStorage.getItem('startCollapsedIfBig') && text.length > 1000000)
var html = jsonObjToHTML(obj, jsonpFunctionName, localStorage.getItem('startCollapsed'));
// Post the HTML string to the content script
diff --git a/extension/js/content.js b/extension/js/content.js
index 2b1808e..23be8f8 100644
--- a/extension/js/content.js
+++ b/extension/js/content.js
@@ -121,7 +121,10 @@
buttonCollapse.addEventListener(
'click',
function () {
- collapse([document.getElementsByClassName('expander')[0].parentNode], true);
+ var firstBlockInner = document.querySelector(".rootDObj > .blockInner");
+ if (firstBlockInner !== null) {
+ collapse(firstBlockInner.children, true);
+ }
}
);
diff --git a/extension/js/options.js b/extension/js/options.js
index 131dce0..8b9e403 100644
--- a/extension/js/options.js
+++ b/extension/js/options.js
@@ -67,6 +67,9 @@
// start JSON collapsed
optionInit("startCollapsedCheckbox");
+ // start JSON collapsed if big json
+ optionInit("startCollapsedIfBigCheckbox");
+
// show always count of children
optionInit("showAlwaysCountCheckbox");
diff --git a/extension/manifest.json b/extension/manifest.json
index fbd7808..0fffaf5 100644
--- a/extension/manifest.json
+++ b/extension/manifest.json
@@ -1,7 +1,7 @@
{
"name": "DJSON. JSON Viewer & Formatter",
"short_name": "DJSON Viewer",
- "version": "0.4.3",
+ "version": "0.4.4",
"manifest_version": 2,
"description": "Extension to format and view JSON, from Web, Input or File.",
"homepage_url": "https://github.com/dardesantis/DJSON-Viewer",
diff --git a/extension/options.html b/extension/options.html
index 37c756d..bf408bf 100644
--- a/extension/options.html
+++ b/extension/options.html
@@ -19,7 +19,9 @@
Theme
Preferences
- Format JSON with collapsed children
+ Format JSON with collapsed children (always)
+
+ Format JSON with collapsed children if is a big JSON (>1MB)
Show always the numbers of items in Objects and Arrays (not only when collapsed)