rknightuk / local-or-live

Chrome extenstion to add a warning bar to websites to indicate if they are local or live.
https://chrome.google.com/webstore/detail/local-or-live/jkaaaiinegnfdfimdmmppljjomlidnlo
10 stars 4 forks source link

Default sync values to empty strings #7

Open jkrehm opened 8 years ago

jkrehm commented 8 years ago

Since the functions expect string values, they should default to empty strings. And since an array with one empty value is returned when splitting a string with a delimiter, we should make sure make sure there's a value before splitting.

As it's currently written, you can't use the extension until you manually populate the textareas via the Options page, because a JS error happens if you use the buttons.

To test repeatedly I had to call chrome.storage.sync.clear() between tests to clear out values.