fix(tracker): fix resources filtering

This commit is contained in:
nick-delirium 2023-10-24 12:09:29 +02:00
parent 9f75be6a4f
commit 964f09b6b2
2 changed files with 11 additions and 2 deletions

View file

@ -557,7 +557,12 @@ export default class App {
const sessionToken = this.session.getSessionToken()
const isNewSession = needNewSessionID || !sessionToken
console.log('OpenReplay: starting session', needNewSessionID, sessionToken)
console.log(
'OpenReplay: starting session; need new session id?',
needNewSessionID,
'session token: ',
sessionToken,
)
return window
.fetch(this.options.ingestPoint + '/v1/web/start', {
method: 'POST',

View file

@ -110,12 +110,16 @@ export default function (app: App, opts: Partial<Options>): void {
if (resources !== null) {
resources[entry.name] = entry.startTime + entry.duration
}
let shouldSkip = false
options.excludedResourceUrls?.forEach((url) => {
if (entry.name.startsWith(url)) {
shouldSkip = true
return
}
})
if (shouldSkip) {
return
}
app.send(
ResourceTiming(
entry.startTime + getTimeOrigin(),