Closed sharat87 closed 10 years ago
Here's a test case:
x
"abc\ndef"
chrome.storage.sync.get('x', function (d) {console.log(d.x);})
abc
def
Now, export to clipboard, delete the x entry and import from clipboard. See the error,
Import from clipboard failed Failed to parse json, error message: Unexpected token
I think the reason is the prettyJson service. You're probably better off using JSON.stringify(data, null, '\t') instead.
prettyJson
JSON.stringify(data, null, '\t')
Thanks for all your work. This is a very nice extension and I'd love to see it more stable.
Here's a test case:
x
for key and"abc\ndef"
for value and save.chrome.storage.sync.get('x', function (d) {console.log(d.x);})
in console gives two lines of output,abc
anddef
as expected.Now, export to clipboard, delete the
x
entry and import from clipboard. See the error,Import from clipboard failed Failed to parse json, error message: Unexpected token
I think the reason is the
prettyJson
service. You're probably better off usingJSON.stringify(data, null, '\t')
instead.Thanks for all your work. This is a very nice extension and I'd love to see it more stable.