-1

I'm trying to make a Chrome app that allows you to upload code to an Arduino (I know there's already some that do that, but I want to make my own) and when I try to run the app I get an error in background.js that says this:

error

I only have the basic window in my background.js though

chrome.app.runtime.onLaunched.addListener(function() {
  chrome.app.window.create('window.html', {
    'outerBounds': {
      'width': 400,
      'height': 500
    }
  });
});
  • 2
    the error has the solution to your question! – Jaromanda X Feb 23 '17 at 22:00
  • 1
    Possible duplicate of [Chrome.Local.Storage update for html5 localstorage Chrome Packaged apps](http://stackoverflow.com/questions/16046844/chrome-local-storage-update-for-html5-localstorage-chrome-packaged-apps) – AmericanUmlaut Feb 23 '17 at 22:04

1 Answers1

0

As the error message says: "window.localStorage is not available in packaged apps. Use chrome.storage.local instead."

Where you are referring to window.localStorage, replace window.localStorage with chrome.storage.local.

AmericanUmlaut
  • 2,817
  • 2
  • 17
  • 27
  • @JordanBaron You surely do. Try a global search for the string localStorage, including all of your libraries. – AmericanUmlaut Feb 23 '17 at 22:16
  • I also thought that I did not reference localStorage, until I did as Jordan suggested and I found that localForage checked for the presence of localStorage – Steve Brooker Oct 12 '18 at 08:37