Skip to content

Commit 287fa1b

Browse files
committed
Add initial extension from example
1 parent d8c1c98 commit 287fa1b

File tree

4 files changed

+29
-4
lines changed

4 files changed

+29
-4
lines changed

DevToolsPlugin.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<script type="module" src="./DevToolsPlugin.js"></script>

DevToolsPlugin.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
export class RecorderPlugin {
2+
async stringify(recording) {
3+
return JSON.stringify(recording, null, 2);
4+
}
5+
async stringifyStep(step) {
6+
return JSON.stringify(step, null, 2);
7+
}
8+
}
9+
10+
/* eslint-disable no-undef */
11+
chrome.devtools.recorder.registerRecorderExtensionPlugin(
12+
new RecorderPlugin(),
13+
/* name=*/ 'Custom JSON',
14+
/* mediaType=*/ 'application/json'
15+
);

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
# testing-library-recorder-extension
22
Testing Library Extension for Chrome DevTools Recorder
3+
4+
## Inspiration
5+
- [Puppeteer Replay example extension](https://github.com/puppeteer/replay/tree/main/examples/chrome-extension)

manifest.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
{
2-
"name": "Getting Started Example",
3-
"description": "Build an Extension!",
4-
"version": "1.0",
5-
"manifest_version": 3
2+
"manifest_version": 3,
3+
"version": "0.1.0",
4+
"name": "CustomJSONExtension",
5+
"description": "DevTools extensions showing how to extend the Recorder panel.",
6+
"permissions": [],
7+
"devtools_page": "DevToolsPlugin.html",
8+
"content_security_policy": {
9+
"extension_pages": "script-src 'self'; object-src 'self'"
10+
},
11+
"minimum_chrome_version": "104.0.5107.0"
612
}

0 commit comments

Comments
 (0)