Skip to content

Commit 2372952

Browse files
committed
Initial
1 parent 85a1b83 commit 2372952

35 files changed

+210658
-0
lines changed

README.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Caplin StreamLink Developer Tools
2+
3+
Caplin StreamLink Developer Tools is an extension that helps developers debug their StreamLink applications.
4+
5+
**Note: this extension should only be used during development.**
6+
7+
![ScreenShot](Screenshot.png)
8+
9+
10+
Features:
11+
- StreamLink Log: The StreamLink log with filtering, find and detail view
12+
- API Log: A list of all calls and callbacks to/from the StreamLink API
13+
- Subscriptions: A list of the current subscriptions and their values
14+
- Tools: Tools to intercept messages, add extra subscriptions and log specific messages to the console.
15+
- Data Flow: A graph of the data sent/received for the last minute
16+
17+
Notes:
18+
- All Tables can be sorted
19+
- Logs and subscription data tables have 'Show Detail' toolbar buttons
20+
- Double click on a subscription will filter the API Log to show just related lines
21+
- Logs will show the last 10,000 lines
22+
- Logs will stick to bottom for a tail type display
23+
- Use the usual keyboard shortcuts (ctrl-a, ctrl-c etc) to copy to the clipboard from the logs
24+
- Tabs can be dragged to re-arrange the gui
25+
26+
## Deployment
27+
28+
Caplin StreamLink Developer Tools can be deployed in multiple ways:
29+
30+
1. As a Chrome extension from the Chrome store
31+
32+
2. As a separate web page launched from the same origin
33+
34+
3. As a Chrome extension loaded from your file system using developer mode
35+
36+
4. As a locally served Chrome extension (.crx file)
37+
38+
In all cases your StreamLink application must be modified
39+
to [enable Developer Tools](#enable-developer-tools-in-your-application), this wraps the StreamLink instance to allow messages to be intercepted.
40+
41+
42+
### 1. As a Chrome extension from the Chrome store
43+
44+
Install the extension from: https://chromewebstore.google.com/detail/caplin-developer-tools/kjkdjjoccokffopdpmhdkghcejhmjlfo
45+
46+
### 2. As a separate webpage launched from the same origin
47+
48+
Download this repo, serve the contents of the webpage directory from the same origin as your StreamLink application (same origin needed since they will communicate using Broadcast channels) then modify the way the StreamLink instance is wrapped to include a second parameter, the location of the background worker [(see below)](#enable-developer-tools-in-your-application). The developer tools gui is then accessed via the webpage served from the webpage/caplin-devtools-gui directory.
49+
50+
51+
### 3. As a Chrome extension loaded from your file system using developer mode
52+
53+
Download this repo, go to the [Chrome extensions page](chrome://extensions/) in your browser, enable developer mode (the button in the top right corner), use the 'Load unpacked' button and select the chrome-extension/extension directory, this will load the extension in developer mode.
54+
55+
### 4. As a locally served Chrome extension (.crx file)
56+
57+
Download this repo, go to the [Chrome extensions page](chrome://extensions/) in your browser, enable developer mode (the button in the top right corner), then choose the 'Pack extension' button and use the chrome-extension/extension directory for the 'Extension root directory', this will create a .crx file containing the extension that can be hosted locally.
58+
59+
## Enable Developer Tools In Your Application
60+
61+
To enable developer tools in your StreamLink application:
62+
```
63+
npm install @caplin/streamlink-devtools --save-dev
64+
```
65+
add the following line to the js/ts file that creates the StreamLink object
66+
```
67+
import {withDevTools} from "@caplin/streamlink-devtools";
68+
```
69+
after creating the StreamLink object wrap it using withDevTools():
70+
```
71+
const unwrappedStreamlink = caplin.streamlink.StreamLinkFactory.create(config);
72+
const streamlink = withDevTools(unwrappedStreamlink);
73+
74+
// or if using the webpage version add the webworker location
75+
// const streamlink = withDevTools(streamlink, "caplin-devtools-webworker.js");
76+
```
77+
use the wrapped StreamLink throughout your application
78+

Screenshot.png

252 KB
Loading
6 KB
Binary file not shown.
6 KB
Binary file not shown.
4.67 KB
Loading

0 commit comments

Comments
 (0)