Skip to content

Commit 0c9ff0c

Browse files
committed
v12.1.1
1 parent c1872ba commit 0c9ff0c

File tree

9 files changed

+2583
-3719
lines changed

9 files changed

+2583
-3719
lines changed

build/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.

demo/index.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,21 @@ <h2 class="sub-headline">
208208
<div class="header-container-image">
209209
<img class="head-image" src="./pexels-niklas-jeromin-12734294.jpg" />
210210
</div>
211+
<canvas id="myCanvas" width="200" height="200" style="border:1px solid #000000;"></canvas>
212+
213+
<script>
214+
var canvas = document.getElementById('myCanvas');
215+
var ctx = canvas.getContext('2d');
216+
var centerX = canvas.width / 2;
217+
var centerY = canvas.height / 2;
218+
var radius = 70;
219+
220+
ctx.beginPath();
221+
ctx.arc(centerX, centerY, radius, 0, 2 * Math.PI);
222+
ctx.fillStyle = 'blue';
223+
ctx.fill();
224+
ctx.stroke();
225+
</script>
211226
<div class="content" id="haha">
212227
<div class="skeleton-text"></div>
213228
<div class="skeleton-text"></div>
@@ -217,6 +232,7 @@ <h2 class="sub-headline">
217232
<div class="skeleton-text"></div>
218233
<div class="skeleton-text"></div>
219234
</div>
235+
220236
</body>
221237

222238
</html>

demo/main.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,18 @@ const Gleap = window.Gleap;
66

77
// Gleap.setLanguage("en");
88

9-
Gleap.initialize("X5C0grjFCjUMbZKi131MjZLaGRwg2iKH");
9+
Gleap.setReplayOptions({
10+
recordCanvas: true,
11+
sampling: {
12+
canvas: 15,
13+
},
14+
dataURLOptions: {
15+
type: 'image/webp',
16+
quality: 0.6,
17+
},
18+
});
19+
20+
Gleap.initialize("U7alA97Vzu15arf4XFpPyxNOdNAv4u0H");
1021

1122
/*Gleap.setUrlHandler((url, newTab) => {
1223
alert("URL: " + url + " newTab: " + newTab);

index.d.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,5 +131,42 @@ export namespace Gleap {
131131
function on(event: string, callback: (data?: any) => void): void;
132132
function getIdentity(): any;
133133
function isUserIdentified(): boolean;
134+
function setReplayOptions(options: {
135+
blockClass?: string | RegExp;
136+
blockSelector?: string;
137+
ignoreClass?: string | RegExp;
138+
ignoreSelector?: string;
139+
ignoreCSSAttributes?: string[];
140+
maskTextClass?: string | RegExp;
141+
maskTextSelector?: string;
142+
maskAllInputs?: boolean;
143+
maskInputOptions?: {
144+
password?: boolean;
145+
[key: string]: any;
146+
};
147+
maskInputFn?: (text: string) => string;
148+
maskTextFn?: (text: string) => string;
149+
slimDOMOptions?: {
150+
[key: string]: any;
151+
};
152+
dataURLOptions?: {
153+
[key: string]: any;
154+
};
155+
hooks?: {
156+
[key: string]: any;
157+
};
158+
packFn?: (events: any) => any;
159+
sampling?: any;
160+
recordCanvas?: boolean;
161+
recordCrossOriginIframes?: boolean;
162+
recordAfter?: 'DOMContentLoaded' | 'load';
163+
inlineImages?: boolean;
164+
collectFonts?: boolean;
165+
userTriggeredOnInput?: boolean;
166+
plugins?: {
167+
[key: string]: any;
168+
}[];
169+
errorHandler?: (error: Error) => void;
170+
}): void;
134171
}
135172
export default Gleap;

published/12.1.1/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.

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/Gleap.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,14 @@ class Gleap {
306306
GleapNetworkIntercepter.getInstance().setMaxRequests(maxRequests);
307307
}
308308

309+
/**
310+
* Set custom replay options.
311+
* @param {*} options
312+
*/
313+
static setReplayOptions(options) {
314+
GleapReplayRecorder.getInstance().setOptions(options);
315+
}
316+
309317
/**
310318
* Closes any open Gleap dialogs.
311319
*/

src/GleapReplayRecorder.js

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export default class GleapReplayRecorder {
66
events = [];
77
bufferSize = 0;
88
stopFunction = undefined;
9+
customOptions = {};
910

1011
// GleapReplayRecorder singleton
1112
static instance;
@@ -20,6 +21,10 @@ export default class GleapReplayRecorder {
2021

2122
constructor() { }
2223

24+
setOptions(options) {
25+
this.customOptions = options;
26+
}
27+
2328
/**
2429
* Start replays
2530
* @returns
@@ -30,38 +35,45 @@ export default class GleapReplayRecorder {
3035
this.startDate = Date.now();
3136
var events = this.events;
3237

38+
var options = {
39+
inlineStylesheet: true,
40+
blockClass: "gl-block",
41+
ignoreClass: "gl-ignore",
42+
maskTextClass: "gl-mask",
43+
dataURLOptions: {
44+
quality: 0.7,
45+
},
46+
recordCanvas: false,
47+
sampling: {
48+
scroll: 150,
49+
mouseInteraction: {
50+
MouseUp: false,
51+
MouseDown: false,
52+
Click: true,
53+
ContextMenu: true,
54+
DblClick: true,
55+
Focus: true,
56+
Blur: true,
57+
TouchStart: true,
58+
TouchEnd: false,
59+
},
60+
},
61+
collectFonts: false,
62+
recordCrossOriginIframes: false,
63+
};
64+
3365
try {
3466
this.stopFunction = rrwebRecord({
67+
...options,
68+
...this.customOptions,
3569
emit(rrwebEvent) {
3670
const { event } = ensureMaxMessageSize(rrwebEvent);
3771
events.push(event);
3872
},
39-
recordCanvas: false,
40-
dataURLOptions: {
41-
quality: 0.7,
42-
},
43-
sampling: {
44-
scroll: 150,
45-
mouseInteraction: {
46-
MouseUp: false,
47-
MouseDown: false,
48-
Click: true,
49-
ContextMenu: true,
50-
DblClick: true,
51-
Focus: true,
52-
Blur: true,
53-
TouchStart: true,
54-
TouchEnd: false,
55-
},
56-
},
57-
collectFonts: false,
58-
inlineStylesheet: true,
59-
recordCrossOriginIframes: false,
60-
blockClass: "gl-block",
61-
ignoreClass: "gl-ignore",
62-
maskTextClass: "gl-mask",
6373
});
64-
} catch (e) { }
74+
} catch (e) {
75+
console.error(e);
76+
}
6577
}
6678

6779
/**

0 commit comments

Comments
 (0)