matrix-org / matrix.to

A simple stateless privacy-protecting URL redirecting service for Matrix
http://matrix.to
Apache License 2.0
893 stars 189 forks source link

Ignore fragment directives #199

Closed easrng closed 3 years ago

easrng commented 3 years ago

When the browser doesn't support fragment directives (Only Chrome does at this point, see https://caniuse.com/mdn-api_fragmentdirective), strip them from the fragment to avoid issues when users follow links with fragment directives.

easrng commented 3 years ago

Ok I got it to work

easrng commented 3 years ago

firefox_2021-03-10_12-22-26 This PR makes Chrome and Firefox (and Safari) act the same when the hash has a :~: section (used in text fragment links) (The highlighting in the bottom right window was added to draw attention to the discrepancy and is not part of the webpage.)

easrng commented 3 years ago

Thanks, looks good! Forgot to mention it earlier, but just need you to sign off your PR.

Oh. I agree to the DCO but am not willing to use my name for this.