Skip to content

Commit e0fa856

Browse files
committed
Use circular-json in order to solve issues with circular structure in states
Related to #26 and #23.
1 parent ec7dd61 commit e0fa856

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252
"webpack": "^1.12.2"
5353
},
5454
"dependencies": {
55+
"circular-json": "^0.3.0",
5556
"crossmessaging": "^0.1.2",
56-
"json-stringify-safe": "^5.0.1",
5757
"react": "^0.14.0",
5858
"react-dom": "^0.14.0",
5959
"react-redux": "^4.0.0",

src/browser/extension/background/messaging.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { onConnect, onMessage, sendToTab } from 'crossmessaging';
2+
import { parse } from 'circular-json';
23
import syncOptions from '../options/syncOptions';
34
import createMenu from './contextMenus';
45
import openDevToolsWindow from './openWindow';
@@ -23,7 +24,7 @@ onConnect((tabId) => {
2324

2425
function parseJSON(data) {
2526
try {
26-
return JSON.parse(data);
27+
return parse(data);
2728
} catch (e) {
2829
// console.error(data + 'is not a valid JSON', e);
2930
return null;

src/browser/extension/inject/pageScript.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import stringify from 'json-stringify-safe';
1+
import { stringify } from 'circular-json';
22
import configureStore from '../../../app/store/configureStore';
33
import { ACTION, UPDATE, OPTIONS, COMMIT } from '../../../app/constants/ActionTypes';
44
import { isAllowed } from '../options/syncOptions';

0 commit comments

Comments
 (0)