This repository has been archived on 2020-10-11. You can view files and clone it, but cannot push or open issues or pull requests.
angularjs-batarang/ARCHITECTURE.md

38 lines
945 B
Markdown
Raw Normal View History

2014-04-01 22:53:54 +00:00
# Batarang Architecture
2014-04-08 21:28:22 +00:00
This document describes the different parts of Batarang and how they interact
with the aim to be useful for anyone that wants to help improve Batarang.
2014-04-01 22:53:54 +00:00
## Parts
2014-04-08 21:28:22 +00:00
### Devtools Elements pane
### Devtools Pane
2014-04-01 22:53:54 +00:00
Dispays stuff
### Instrumentation
2014-04-08 21:28:22 +00:00
Hooks into the app to give you stats and access to the models.
2014-04-01 22:53:54 +00:00
### Background Page
- Lets us communicate between app and devtools pane
- Stores state
## Bootstrap
2014-04-08 21:28:22 +00:00
How does Batarang start? When a tab is opened in Chrome:
2014-04-01 22:53:54 +00:00
2014-04-08 21:28:22 +00:00
1. Chrome reads the `manifest.json` specifically the `content_scripts` field.
2. content script `conent-scripts/inject.js`
* checks for the presense of an `__ngDebug` cookie
* embeds `<script>` into the app's `<head>`
- adds a mutation listener
2014-04-01 22:53:54 +00:00
4. proxy elt
5. app context patches angular
6. emits events to content script
7. content script sends messages to the backgroung page
8. backgroung page emits events to the devtools pane