-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
rrweb extension implementation #1044
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
b70254c
feat: add rrweb web-extension package
YunFeng0817 be295bd
refactor: make the extension suitable for manifest v3
YunFeng0817 6d7ae5d
update tsconfig.json
YunFeng0817 c99b049
use version_name rather than recorder_version in manifest.json
YunFeng0817 e87d539
update manifest.json
YunFeng0817 579d5b8
enable to keep recording after changing tabs
YunFeng0817 8739a6f
enable to record between tabs and urls
YunFeng0817 6fd4f2a
fix CI error
YunFeng0817 7fbc406
Merge branch 'master' into extension
YunFeng0817 3209471
try to fix CI error
YunFeng0817 f134ddc
feat: add pause and resume buttons
YunFeng0817 ab0b588
feat: add a link to new session after recording
YunFeng0817 0d633e5
improve session list
YunFeng0817 8246457
refactor: migrate session storage from chrome local storage to indexedDB
YunFeng0817 5fe51f1
feat: add pagination to session list
YunFeng0817 1266dae
fix: multiple recorders are started after pausing and resuming process
YunFeng0817 6186f6a
fix: can't stop recording on firefox browser
YunFeng0817 0c7e5ef
Merge remote-tracking branch 'origin/master' into extension
YunFeng0817 5340919
update type import of 'eventWithTime'
YunFeng0817 9670fd3
fix CI error
YunFeng0817 196082b
doc: add readme
YunFeng0817 558ec5d
Merge branch 'master' into extension
YunFeng0817 c0126c9
Apply suggestions from Justin's code review
YunFeng0817 2d35e10
refactor: make use of webNavigation API to implement recording consis…
YunFeng0817 2fbd399
fix firefox compatibility issue and add title to pages
YunFeng0817 4a56727
add mouseleave listener to enhance the recording liability
YunFeng0817 6abfb40
fix firefox compatibility issue and improve the experience of recordi…
YunFeng0817 c931c51
Merge branch 'master' into extension
YunFeng0817 da99bc2
update tsconfig
YunFeng0817 d65135c
upgrade vite-plugin-web-extension config to fix some bugs on facebook…
YunFeng0817 f08f334
update import links
YunFeng0817 46140be
refactor: cross tab recording mechanism
YunFeng0817 6665ca4
Merge branch 'master' into extension
YunFeng0817 36248e2
refactor: slipt util/index.ts into multiple files
YunFeng0817 d978ab6
implement cross-origin iframe recording
YunFeng0817 70e6155
fix: regression of issue: ShadowHost can't be a string (issue 941)
YunFeng0817 407a48a
refactor shadow dom recording to make tests cover key code
YunFeng0817 719ca76
Merge branch 'master' into extension
YunFeng0817 2409f76
Merge branch 'fix-shadow-dom-bug' into extension
YunFeng0817 1174194
Merge branch 'master' into extension
YunFeng0817 4e779f9
Apply formatting changes
36a8c00
increase the node memory limitation to avoid CI failure
YunFeng0817 6101714
Merge remote-tracking branch 'origin/master' into extension
YunFeng0817 1041fac
Create lovely-pears-cross.md
Juice10 1e4c582
Apply formatting changes
Juice10 86a88e0
Update packages/web-extension/package.json
Juice10 1f8a29a
Update .changeset/lovely-pears-cross.md
Juice10 3e5ab6f
Merge branch 'master' into extension
YunFeng0817 802b9b2
update change logs
YunFeng0817 832d7eb
delete duplicated property
YunFeng0817 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
refactor: migrate session storage from chrome local storage to indexedDB
- Loading branch information
commit 824645708c7faa4807ed97ac378f07f3a87446a6
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,15 @@ | ||
| import { useRef, useEffect, useState } from 'react'; | ||
| import { useParams } from 'react-router-dom'; | ||
| import Browser from 'webextension-polyfill'; | ||
| import type rrwebPlayer from 'rrweb-player'; | ||
| import rrwebPlayer from 'rrweb-player'; | ||
| import Replayer from 'rrweb-player'; | ||
| import { LocalData } from '../types'; | ||
| import { | ||
| Box, | ||
| Breadcrumb, | ||
| BreadcrumbItem, | ||
| BreadcrumbLink, | ||
| Center, | ||
| } from '@chakra-ui/react'; | ||
| import { getEvents, getSession } from '../utils'; | ||
|
|
||
| export default function Player() { | ||
| const playerElRef = useRef<HTMLDivElement>(null); | ||
|
|
@@ -19,27 +18,38 @@ export default function Player() { | |
| const [sessionName, setSessionName] = useState(''); | ||
|
|
||
| useEffect(() => { | ||
| void Browser.storage.local.get().then((data) => { | ||
| if (!playerElRef.current || !sessionId) return; | ||
| const localData = data as LocalData; | ||
| const session = localData.sessions[sessionId]; | ||
| if (!session) return; | ||
| setSessionName(session.name); | ||
| if (!sessionId) return; | ||
| getSession(sessionId) | ||
| .then((session) => { | ||
| setSessionName(session.name); | ||
| }) | ||
| .catch((err) => { | ||
| console.error(err); | ||
| }); | ||
| getEvents(sessionId) | ||
| .then((events) => { | ||
| if (!playerElRef.current || !sessionId) return; | ||
|
|
||
| const linkEl = document.createElement('link'); | ||
| linkEl.href = | ||
| 'https://cdn.jsdelivr.net/npm/[email protected]/dist/style.css'; | ||
| linkEl.rel = 'stylesheet'; | ||
| document.head.appendChild(linkEl); | ||
| playerRef.current = new Replayer({ | ||
| target: playerElRef.current as HTMLElement, | ||
| props: { | ||
| events: session.events, | ||
| autoPlay: true, | ||
| }, | ||
| const linkEl = document.createElement('link'); | ||
| linkEl.href = | ||
| 'https://cdn.jsdelivr.net/npm/[email protected]/dist/style.css'; | ||
| linkEl.rel = 'stylesheet'; | ||
| document.head.appendChild(linkEl); | ||
| playerRef.current = new Replayer({ | ||
| target: playerElRef.current as HTMLElement, | ||
| props: { | ||
| events, | ||
| autoPlay: true, | ||
| }, | ||
| }); | ||
| }) | ||
| .catch((err) => { | ||
| console.error(err); | ||
| }); | ||
| }); | ||
| }, []); | ||
| return () => { | ||
| playerRef.current?.pause(); | ||
| }; | ||
| }, [sessionId]); | ||
|
|
||
| return ( | ||
| <> | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.