Skip to content

[Bug]: Path transformation logic for stylesheet URLs produce wrong output #1391

@navaneethsdk

Description

@navaneethsdk

Preflight Checklist

  • I have searched the issue tracker for a bug report that matches the one I want to file, without success.

What package is this bug report for?

rrweb

Version

2.0.0-alpha.11

Expected Behavior

The path transformation logic should ideally preserve protocol URLs without transforming them.

Actual Behavior

Here is a quick video demonstrating the issue: https://navaneeth-d.neetorecord.com/watch/99b36158-a56b-4bbb-af8a-8c66ecf67b77

Steps to Reproduce

  1. Include a protocol URL like chrome-extension://liecbddmkiiihnedobmlmillhodjkdmb/fonts/CircularXXWeb-Bold.woff2 within the stylesheet of the host. Eg:
@font-face {
  font-weight: 400;
  font-style:  normal;
  font-family: circular;

  src: url('chrome-extension://liecbddmkiiihnedobmlmillhodjkdmb/fonts/CircularXXWeb-Book.woff2') format('woff2');
}
  1. Inspect the recorded session to find the transformed URL as follows: http://localhost:8080/chrome-extension://liecbddmkiiihnedobmlmillhodjkdmb/fonts/CircularXXWeb-Book.woff2

Testcase Gist URL

No response

Additional Information

The PR #1130 already included a fix for this but it doesn't cover all the edge cases (chrome-extension). Altering the regex should fix the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions