-
Notifications
You must be signed in to change notification settings - Fork 1.4k
PouchDB on Chrome Applications
Currently, functionality in Chrome Applications is pretty rudimentary. Actually, that was sort of a lie. Here's the explanation:
Nearly all of PouchDB works fine on Chrome Apps, except for the fact that the latest manifest version (manifest version 2) absolutely bans the use of eval()
in Chrome applications. Makes sense, because eval()
is insecure, but it means that the parts of our code that uses eval()
just don't work unless you use an older manifest version.
To complicate matters, the older manifest version has actually been phased out in the newer versions of Chrome.
You can actually work around this using sandboxing.
I have a working example of a Chrome app that doesn't use eval()
at chromepouch.com.
How to test or use the functionality for Chrome Apps:
Two options:
- You want to test the tests which use
eval()
in some way shape or form:- Install a version of Chrome that's before when they took the legacy stuff out, which included the ability to mess with security like we did and enable
eval()
's. Go here for details on the old version. - Go to chrome extensions, enable developer mode, install the package app from the pouchdb directory. Run the app. This brings up test.html, the web runner. The tests should all pass.
- Install a version of Chrome that's before when they took the legacy stuff out, which included the ability to mess with security like we did and enable
- You don't mind that all the tests which use
eval()
in some way shape or form fail:- Change the
manifest_version
inmanifest.json
to2
, instead of1
which it currently is - Go to Chrome extensions, enable Developer Mode, install the package app from the Pouchdb directory. Run the app. This brings up test.html, the web runner.
- Change the