File tree 2 files changed +11
-8
lines changed
packages/rrweb-snapshot/src
2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,12 @@ import {
8
8
type legacyAttributes ,
9
9
} from '@posthog/rrweb-types' ;
10
10
import { type tagMap , type BuildCache } from './types' ;
11
- import { isElement , Mirror , isNodeMetaEqual } from './utils' ;
11
+ import {
12
+ isElement ,
13
+ Mirror ,
14
+ isNodeMetaEqual ,
15
+ extractFileExtension ,
16
+ } from './utils' ;
12
17
import postcss from 'postcss' ;
13
18
14
19
const tagMap : tagMap = {
@@ -271,16 +276,15 @@ function buildNode(
271
276
continue ;
272
277
} else if (
273
278
tagName === 'link' &&
274
- ( n . attributes . rel === 'preload' ||
275
- n . attributes . rel === 'modulepreload' ) &&
276
- n . attributes . as === 'script'
279
+ ( ( n . attributes . rel === 'preload' && n . attributes . as === 'script' ) ||
280
+ n . attributes . rel === 'modulepreload' )
277
281
) {
278
282
// ignore
279
283
} else if (
280
284
tagName === 'link' &&
281
285
n . attributes . rel === 'prefetch' &&
282
286
typeof n . attributes . href === 'string' &&
283
- n . attributes . href . endsWith ( '. js')
287
+ extractFileExtension ( n . attributes . href ) === ' js'
284
288
) {
285
289
// ignore
286
290
} else if (
Original file line number Diff line number Diff line change @@ -851,9 +851,8 @@ function slimDOMExcluded(
851
851
( sn . tagName === 'script' ||
852
852
// (module)preload link
853
853
( sn . tagName === 'link' &&
854
- ( sn . attributes . rel === 'preload' ||
855
- sn . attributes . rel === 'modulepreload' ) &&
856
- sn . attributes . as === 'script' ) ||
854
+ ( ( sn . attributes . rel === 'preload' && sn . attributes . as === 'script' ) ||
855
+ sn . attributes . rel === 'modulepreload' ) ) ||
857
856
// prefetch link
858
857
( sn . tagName === 'link' &&
859
858
sn . attributes . rel === 'prefetch' &&
You can’t perform that action at this time.
0 commit comments