This addresses [issue 7] by making it possible for users to run:
```sh
npm install webextension-polyfill
```
and download a module that they can use with a bundler as follows:
```js
import browser from 'webextension-polyfill';
```
Also, add a [prepublish script] so that users who clone the repo don't
need to run `grunt` manually. In addition, specify [files] in
package.json so that this module can be published to npm without
including miscellanea. This can be verified by running:
```sh
npm pack && tar -tvf webextension-polyfill-0.1.0.tgz
```
[issue 7]: https://github.com/mozilla/webextension-polyfill/issues/7
[files]: https://docs.npmjs.com/files/package.json#files
[prepublish script]: https://docs.npmjs.com/misc/scripts
- if the a browser global already exists, it should not be overridden
- use Object.defineProperty on the wrapped browser global
(and test "has" for cached properties)
- delete a property defined with Object.defineProperty
- methods that are not wrapped are proxied correctly
- the special onMessage wrapper should not wrap a listener that is not
a function
- test that a returned rejected Promise on the onMessage listener
is turned in the parameter of the sendResponse callback