Skip to content

Commit

Permalink
feat: support modulepreload for reverse proxy (#18524)
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra authored Nov 9, 2023
1 parent 7cf0229 commit 618f55f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion frontend/src/scenes/session-recordings/player/rrweb/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@ export const CorsPlugin: ReplayPlugin & {

if (node.nodeName === 'LINK') {
const linkElement = node as HTMLLinkElement
linkElement.href = CorsPlugin._replaceFontUrl(linkElement.href)
const href = linkElement.href
if (!href) {
return
}
if (linkElement.getAttribute('rel') == 'modulepreload') {
linkElement.href = CorsPlugin._replaceJSUrl(href)
} else {
linkElement.href = CorsPlugin._replaceFontUrl(href)
}
}

if (node.nodeName === 'SCRIPT') {
Expand Down

0 comments on commit 618f55f

Please sign in to comment.