jusio / storage-area-explorer

Extension for Chrome with allows to inspect storage area of Chrome Packages Apps
Other
171 stars 33 forks source link

Newlines in values break import/export #10

Closed sharat87 closed 10 years ago

sharat87 commented 10 years ago

Here's a test case:

  1. Open a storage area (sync or local) and click on 'Add Item'.
  2. Enter x for key and "abc\ndef" for value and save.
  3. Check chrome.storage.sync.get('x', function (d) {console.log(d.x);}) in console gives two lines of output, abc and def as expected.
  4. 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.

Thanks for all your work. This is a very nice extension and I'd love to see it more stable.