tfoxy / chrome-promise

Promises for chrome JavaScript APIs used in extensions and apps.
MIT License
150 stars 14 forks source link

Mention that only APIs that are enabled in the manifest will be available #13

Closed fwextensions closed 7 years ago

fwextensions commented 7 years ago

This may be obvious to some, but I just ran into it. I wanted to access bookmarks via new ChromePromise().bookmarks.getTree() but it was undefined. At first I thought it might be something wrong with this library, as it seemed strange that it wouldn't support the bookmarks API. A quick look at the source made me realize it wasn't available because it wasn't on the chrome object, because I hadn't added the bookmarks permission to the manifest yet. Duh.

So it might be worth pointing that out in the Warnings section of the README. If something's undefined on a ChromePromise, it means you need to add it to the permissions.

tfoxy commented 7 years ago

No problem. Will add it in a few days.