Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not fetch disabled links, but copy over all attributes to new link. #262

Merged
merged 4 commits into from
Oct 15, 2024

Conversation

jgerigmeyer
Copy link
Member

Description

This doesn't yet include the full fix for #246 because we don't have a robust solution for running the polyfill multiple times on the same page, but it makes two changes:

  1. Links with disabled are now ignored entirely.
  2. All attributes are copied over from the original link to the new one.

Related Issue(s)

Fixes #254.

@jgerigmeyer jgerigmeyer requested a review from jamesnw October 14, 2024 20:14
Copy link

netlify bot commented Oct 14, 2024

Deploy Preview for anchor-position-wpt canceled.

Name Link
🔨 Latest commit 2895255
🔍 Latest deploy log https://app.netlify.com/sites/anchor-position-wpt/deploys/670e8fc0d07b75000867357c

Copy link

netlify bot commented Oct 14, 2024

Deploy Preview for anchor-polyfill ready!

Name Link
🔨 Latest commit 2895255
🔍 Latest deploy log https://app.netlify.com/sites/anchor-polyfill/deploys/670e8fc0de24330008d24f90
😎 Deploy Preview https://deploy-preview-262--anchor-polyfill.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

* main:
  Add more waiting in tests
Copy link
Contributor

@jamesnw jamesnw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I think in addition to the mutation observer, we may still want to separately address things like integrity or referrerpolicy, or event handlers that we don't want to bring over. These were initially raised in #242.

@jgerigmeyer
Copy link
Member Author

LGTM! I think in addition to the mutation observer, we may still want to separately address things like integrity or referrerpolicy, or event handlers that we don't want to bring over. These were initially raised in #242.

Hm, good point. Do you think it would be worth compiling a list of either the attributes we want to explicitly exclude, or explicitly include? It's not perfect, but might be better than either the current implementation or this PR?

@jgerigmeyer jgerigmeyer requested a review from jamesnw October 15, 2024 15:51
Copy link
Contributor

@jamesnw jamesnw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good!

@jgerigmeyer jgerigmeyer merged commit 49081d8 into main Oct 15, 2024
12 checks passed
@jgerigmeyer jgerigmeyer deleted the link-attrs branch October 15, 2024 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Data attributes get stripped from stylesheet <link>s
2 participants