You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/README.md
+26-1Lines changed: 26 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,9 +49,13 @@ src/
49
49
50
50
1. The *app* folder is responsible for the Single Page Application that you see when you open the chrome dev tools under the Reactime tab.
51
51
52
+

53
+
52
54
2. The *backend* folder contains the set of all scripts that we inject into our "target" application via `background.js`
53
55
- In Reactime, its main role is to generate data and handle time-jump requests from the background script in our *extension* folder.
54
56
57
+

58
+
55
59
3. The *extension* folder is where the `contentScript.js` and `background.js` are located.
56
60
- Like regular web apps, Chrome Extensions are event-based. The background script is where one typically monitors for browser triggers (e.g. events like closing a tab, for example). The content script is what allows us to read or write to our target web application, usually as a result of [messages passed](https://developer.chrome.com/extensions/messaging) from the background script.
57
61
- These two files help us handle requests both from the web browser and from the Reactime extension itself
@@ -60,7 +64,7 @@ src/
60
64
61
65
The general flow of data is described in the following steps:
62
66
63
-

67
+

64
68
65
69
1. When the background bundle is loaded by the browser, it executes a script injection into the dom. (see section on *backend*). This script uses a technique called [throttle](https://medium.com/@bitupon.211/debounce-and-throttle-160affa5457b) to send state data from the app to the content script every specified milliseconds (in our case, this interval is 70ms).
66
70
@@ -69,6 +73,27 @@ The general flow of data is described in the following steps:
69
73
3. Likewise, when Reactime emits an action due to user interaction -- a "jump" request for example -- a message will be passed from Reactime via the background script to the content script. Then, the content script will pass a message to the target application containing a payload that represents the state the user wants the DOM to reflect or "jump" to.
70
74
- One important thing to note here is that this jump action must be dispatched in the target application (i.e. *backend* land), because only there do we have direct access to the DOM.
71
75
76
+
## Console.log
77
+
78
+
Navigation between different console.log panels can be confusing when running Reactime. We created a short instruction where you can find the results for your console.log
79
+
80
+
### <b> /src/extension </b>
81
+
Console.logs from the Extension folder you can find here:
82
+
- Chrome Extension (Developer mode)
83
+
- Background page
84
+

85
+
86
+
### <b> /src/app </b>
87
+
Console.logs from the App folder you can find here:
88
+
- Chrome Browser
89
+
- Inspect
90
+

91
+
92
+
### <b> /src/backend </b>
93
+
Console.logs from the App folder you can find here:
94
+
- Open the Reactime extension in Chrome
95
+
- Click "Inspect" on Reactime
96
+

72
97
73
98
## Chrome Developer Resources
74
99
Still unsure about what content scripts and background scripts do for Reactime, or for a chrome extensions in general?
0 commit comments