https://github.com/bengreenier-archive/chrome-zones
wraps chrome extension apis so that if they are executing in a zone, their callbacks do too
https://github.com/bengreenier-archive/chrome-zones
angular chrome-extension
Last synced: 3 months ago
JSON representation
wraps chrome extension apis so that if they are executing in a zone, their callbacks do too
- Host: GitHub
- URL: https://github.com/bengreenier-archive/chrome-zones
- Owner: bengreenier-archive
- License: mit
- Created: 2016-07-02T19:02:02.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-02-16T01:13:36.000Z (over 9 years ago)
- Last Synced: 2024-10-12T09:12:05.906Z (almost 2 years ago)
- Topics: angular, chrome-extension
- Language: JavaScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# chrome-zones
[](https://travis-ci.org/bengreenier/chrome-zones)
wraps chrome extension apis so that if they are executing in a zone, their callbacks do too
# Why?
If, for instance, you wish to use angular2 in a chrome extension, and want to change
renderable/injectable/etc values from within a chrome extension api callback.
# How?
## Do i use it?
> `npm install chrome-zones` is the easiest.
If npm is too heavy for you, grab a built version [from this repo](./dist). Note
that you'll also need [angular/zone.js](https://github.com/angular/zone.js) included
in your page.
### Example
> An example of an angular2 powered chrome extension can be found @ [bengreenier/angular2-chrome-zones-quickstart](https://github.com/bengreenier/angular2-chrome-zones-quickstart)
See [example](./example) for a complete working example.
## Angular CLI
Just add it to the scripts array in your `angular-cli.json`
```!JSON
"scripts": [
"../node_modules/chrome-zones/dist/chrome-zones.min.js"
]
```
## Does it work?
Using monkeypatching and `zone.wrap`. Basically when the script loads
it patches the entire `chrome.` api space such that all
functions that are called have their last argument (if it is a function)
patched with `zone.wrap`.
# License
MIT