这是indexloc提供的服务,不要输入任何密码
Skip to content

[BUG] Data attributes get stripped from stylesheet <link>s #254

@tysongach

Description

@tysongach

Describe the bug

The polyfill appears to be stripping data attributes.

Without the polyfill, my link looks like this:

<link rel="stylesheet" href="/assets/application-3282d104.css" data-turbo-track="reload" media="screen">

And when I add the polyfill, I get this:

<link rel="stylesheet" href="blob:http://localhost:3000/ae9daae1-2ee9-44e5-914b-2a829a711088">

Note that media also gets stripped and should be kept, but I believe #243 resolves that. Looking at those code changes, I don’t believe it accounts for data attributes, though.

To Reproduce
Use the polyfill.

Expected behavior
Existing data attributes should still exist on the link when polyfill is applied.

Browsers tested on
macOS, Firefox 131

Additional context
I’m seeing this issue in a Rails application with Turbo.

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