Skip to content

Commit 7461da2

Browse files
committed
v14.6.7
1 parent 7a92ab8 commit 7461da2

File tree

7 files changed

+126
-2609
lines changed

7 files changed

+126
-2609
lines changed

build/cjs/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/esm/index.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

package-lock.json

Lines changed: 105 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gleap",
3-
"version": "14.6.6",
3+
"version": "14.6.7",
44
"main": "build/cjs/index.js",
55
"module": "build/esm/index.mjs",
66
"exports": {
@@ -71,6 +71,7 @@
7171
},
7272
"dependencies": {
7373
"@floating-ui/dom": "^1.6.3",
74+
"@rrweb/record": "^2.0.0-alpha.18",
7475
"unique-selector": "^0.5.0"
7576
}
7677
}

published/latest/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/GleapReplayRecorder.js

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { isMobile } from "./GleapHelper";
2-
import { rrwebRecord } from "./RRWebRecorder.js";
2+
import { record } from "@rrweb/record";
33

44
export default class GleapReplayRecorder {
55
startDate = undefined;
@@ -19,15 +19,15 @@ export default class GleapReplayRecorder {
1919
}
2020
}
2121

22-
constructor() { }
22+
constructor() {}
2323

2424
setOptions(options) {
2525
this.customOptions = options;
2626
}
2727

2828
/**
2929
* Start replays
30-
* @returns
30+
* @returns
3131
*/
3232
start() {
3333
this.stop();
@@ -63,7 +63,7 @@ export default class GleapReplayRecorder {
6363
};
6464

6565
try {
66-
this.stopFunction = rrwebRecord({
66+
this.stopFunction = record({
6767
...options,
6868
...this.customOptions,
6969
emit(rrwebEvent) {
@@ -78,7 +78,7 @@ export default class GleapReplayRecorder {
7878

7979
/**
8080
* Stop replays
81-
* @returns
81+
* @returns
8282
*/
8383
stop() {
8484
if (this.stopFunction) {
@@ -102,7 +102,7 @@ export default class GleapReplayRecorder {
102102
width: window.innerWidth,
103103
height: window.innerHeight,
104104
isMobile: isMobile(),
105-
type: 'rrweb',
105+
type: "rrweb",
106106
};
107107

108108
return replayResult;
@@ -112,15 +112,18 @@ export default class GleapReplayRecorder {
112112
export function ensureMaxMessageSize(data) {
113113
let stringifiedData = JSON.stringify(data);
114114
if (stringifiedData.length > 4000000) {
115-
const dataURIRegex = /data:([\w\/\-\.]+);(\w+),([^)"]*)/gim
116-
const matches = stringifiedData.matchAll(dataURIRegex)
115+
const dataURIRegex = /data:([\w\/\-\.]+);(\w+),([^)"]*)/gim;
116+
const matches = stringifiedData.matchAll(dataURIRegex);
117117
for (const match of matches) {
118-
if (match[1].toLocaleLowerCase().slice(0, 6) === 'image/') {
119-
stringifiedData = stringifiedData.replace(match[0], 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAQSURBVHgBAQUA+v8ABRg5/wHSAVZN1mnaAAAAAElFTkSuQmCC')
118+
if (match[1].toLocaleLowerCase().slice(0, 6) === "image/") {
119+
stringifiedData = stringifiedData.replace(
120+
match[0],
121+
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAQSURBVHgBAQUA+v8ABRg5/wHSAVZN1mnaAAAAAElFTkSuQmCC"
122+
);
120123
} else {
121-
stringifiedData = stringifiedData.replace(match[0], '')
124+
stringifiedData = stringifiedData.replace(match[0], "");
122125
}
123126
}
124127
}
125-
return { event: JSON.parse(stringifiedData), size: stringifiedData.length }
126-
}
128+
return { event: JSON.parse(stringifiedData), size: stringifiedData.length };
129+
}

0 commit comments

Comments
 (0)