Jump to content

Phaser and Chrome Web Store


spinnerbox
 Share

Recommended Posts

So yes Chrome has its own local storage API. I used

chrome.storage.local.set({"item": itemValue});

and

chrome.storage.local.get("item", function (result) {console.log(result);});

For all my storage calls.

 

The problem I face is Phaser.js includes localStorage statement somewhere inside of it, which doesn't allow me to view my game at all. So Instead I get this error in console:

window.localStorage is not available in packaged apps. Use chrome.storage.local

and a black screen.

 

What would you do in this case?

 

Is there some functionality I could turn off in Phaser or I just don't bother with Chrome Web Store at all?

Link to comment
Share on other sites

Hehe quick workaround:

window.localStorage = undefined;

Need to test it, but at least chrome doesn't complain.

 

Don't do this in your builds for other browsers.

 

In case you want to try building extensions for Chrome: https://developer.chrome.com/extensions/getstarted

https://developer.chrome.com/extensions/storage

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...