feat(tracker-assist): 3.4.16: improve scroll, ignore Fetch, peerjs logs

This commit is contained in:
ShiKhu 2022-01-23 17:52:58 +01:00
parent 5e82278b4d
commit 7196b81979
4 changed files with 11 additions and 6 deletions

View file

@ -1,7 +1,7 @@
{
"name": "@openreplay/tracker-assist",
"description": "Tracker plugin for screen assistance through the WebRTC",
"version": "3.4.13",
"version": "3.4.16",
"keywords": [
"WebRTC",
"assistance",

View file

@ -6,12 +6,13 @@ interface Message {
}
// 16kb should be max according to specification
// 64kb chrome
const crOrFf: boolean =
typeof navigator !== "undefined" &&
(navigator.userAgent.indexOf("Chrom") !== -1 || // Chrome && Chromium
navigator.userAgent.indexOf("Firefox") !== -1);
const MESSAGES_PER_SEND = crOrFf ? 500 : 100
const MESSAGES_PER_SEND = crOrFf ? 200 : 50
// Bffering required in case of webRTC
export default class BufferingConnection {
@ -34,7 +35,10 @@ export default class BufferingConnection {
send(messages: Message[]) {
if (!this.conn.open) { return; }
let i = 0;
//@ts-ignore
messages=messages.filter(m => m._id !== 39)
while (i < messages.length) {
this.buffer.push(messages.slice(i, i+=this.msgsPerSend))
}
if (!this.buffering) {

View file

@ -47,11 +47,12 @@ export default class Mouse {
}
}
private readonly pScrEl = document.scrollingElement || document.documentElement
private readonly pScrEl = document.scrollingElement || document.documentElement // Is it always correct
private lastScrEl: Element | "window" | null = null
private resetLastScrEl = () => { this.lastScrEl = null }
private handleWScroll = e => {
if (e.target !== this.lastScrEl) {
if (e.target !== this.lastScrEl &&
this.lastScrEl !== "window") {
this.resetLastScrEl()
}
}

View file

@ -27,7 +27,7 @@ enum CallingState {
};
//@ts-ignore peerjs hack for webpack5 (?!) TODO: ES/node modules;
//Peer = Peer.default || Peer;
Peer = Peer.default || Peer;
// type IncomeMessages =
// "call_end" |
@ -86,7 +86,7 @@ export default function(opts?: Partial<Options>) {
host: app.getHost(),
path: '/assist',
port: location.protocol === 'http:' && appOptions.__DISABLE_SECURE_MODE ? 80 : 443,
//debug: // 0 Print nothing //1 Prints only errors. / 2 Prints errors and warnings. / 3 Prints all logs.
debug: appOptions.__debug_log ? 2 : 0, // 0 Print nothing //1 Prints only errors. / 2 Prints errors and warnings. / 3 Prints all logs.
}
if (options.config) {
_opt['config'] = options.config