fix(tracker): added excludedResourceUrls for timings
This commit is contained in:
parent
d0e189b0cf
commit
ca84dd0c0b
2 changed files with 12 additions and 0 deletions
|
|
@ -3,6 +3,10 @@
|
|||
- networkRequest message changed to include `TransferredBodySize`
|
||||
- tracker now attempts to create proxy for beacon api as well (if its in scope)
|
||||
|
||||
# 9.0.10
|
||||
|
||||
- added `excludedResourceUrls` to timings options to better sanitize network data
|
||||
|
||||
# 9.0.9
|
||||
|
||||
- Fix for `{disableStringDict: true}` behavior
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ export interface Options {
|
|||
captureResourceTimings: boolean
|
||||
capturePageLoadTimings: boolean
|
||||
capturePageRenderTimings: boolean
|
||||
excludedResourceUrls?: Array<string>
|
||||
}
|
||||
|
||||
export default function (app: App, opts: Partial<Options>): void {
|
||||
|
|
@ -91,6 +92,7 @@ export default function (app: App, opts: Partial<Options>): void {
|
|||
captureResourceTimings: true,
|
||||
capturePageLoadTimings: true,
|
||||
capturePageRenderTimings: true,
|
||||
excludedResourceUrls: [],
|
||||
},
|
||||
opts,
|
||||
)
|
||||
|
|
@ -108,6 +110,12 @@ export default function (app: App, opts: Partial<Options>): void {
|
|||
if (resources !== null) {
|
||||
resources[entry.name] = entry.startTime + entry.duration
|
||||
}
|
||||
|
||||
options.excludedResourceUrls?.forEach((url) => {
|
||||
if (entry.name.startsWith(url)) {
|
||||
return
|
||||
}
|
||||
})
|
||||
app.send(
|
||||
ResourceTiming(
|
||||
entry.startTime + getTimeOrigin(),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue