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

Strips fragment from parent document after generating link from content in iframe. #14

Open
RokeJulianLockhart opened this issue Nov 14, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@RokeJulianLockhart
Copy link
Contributor

RokeJulianLockhart commented Nov 14, 2024

Errata

  1. Example

    Original https://mail.proton.me/u/6/almost-all-mail/2pmw0JglyiQHpIMGgvn05Pq4SoTeUMiMooISZDWRNp3KClTVevNTGlzOVgGeUWfxd8cCW_Qo1MxhRI97JtEPpA==/l-IcfP9WeRPXRO8VySNI7zgeN0V-E1nWb4UtTDXP5xHgWwd8KUzUIWn_ote-ga5wyZzU8JjPealLpJCO1jPS-w==#keyword=Mobile+Firefox%3A+Other&begin=1731369600&end=1731628800&from=w0q9hlr8%40rokejulianlockhart.addy.io
    Result https://mail.proton.me/u/6/almost-all-mail/2pmw0JglyiQHpIMGgvn05Pq4SoTeUMiMooISZDWRNp3KClTVevNTGlzOVgGeUWfxd8cCW_Qo1MxhRI97JtEPpA==/l-IcfP9WeRPXRO8VySNI7zgeN0V-E1nWb4UtTDXP5xHgWwd8KUzUIWn_ote-ga5wyZzU8JjPealLpJCO1jPS-w==#:~:text=Your%20request%20(-,3233006,-)%20has%20been
    Expected https://mail.proton.me/u/6/almost-all-mail/2pmw0JglyiQHpIMGgvn05Pq4SoTeUMiMooISZDWRNp3KClTVevNTGlzOVgGeUWfxd8cCW_Qo1MxhRI97JtEPpA==/l-IcfP9WeRPXRO8VySNI7zgeN0V-E1nWb4UtTDXP5xHgWwd8KUzUIWn_ote-ga5wyZzU8JjPealLpJCO1jPS-w==#keyword=Mobile+Firefox%3A+Other&begin=1731369600&end=1731628800&from=w0q9hlr8%40rokejulianlockhart.addy.io:~:text=Your%20request%20(-,3233006,-)%20has%20been
  2. Reproduction

    2024-11-14.13-32-59.mp4

    You can also watch this at YouTube.

Environment

Firefox fedora.pkgs.org/41/fedora-updates-x86_64/firefox-132.0.1-2.fc41.x86_64.rpm.html
Extension addons.mozilla.org/firefox/downloads/file/4384827/text_fragment-1.1.xpi
@ichaoX
Copy link
Owner

ichaoX commented Nov 14, 2024

Hello, this is the expected behavior.

https://wicg.github.io/scroll-to-text-fragment/#search-invisible:~:text=A%20node%20is%20search%20invisible,of%20the%20following%20types:%20HTMLIFrameElement

https://wicg.github.io/scroll-to-text-fragment/#:~:text=top%20level%20navigables%20(i.e.%20no%20iframes).

The link you want to create is inside an <iframe>, and its src does not include the fragment. You can check this by context menu > This Frame > Frame Info > Address.

@RokeJulianLockhart
Copy link
Contributor Author

@ichaoX, thanks for that. If it's deliberately not possible, then I suppose the current title shouldn't be resolved. However, I still think that the user should be notified of this, so that they don't accidentally change what's being navigated to. Should I rename the issue so?

I ask because I can think of situations in which the content of an iframe is dynamic, but the id of its adjacent element is static, so being able to navigate to that iframe is expected.

Irrespective, WICG/scroll-to-text-fragment#240 (comment), linked to from your aforereferenced section of the specification, seems to indicate that the specification maintainers are considering whether to permit this, and that it's already possible in Chrome (to an extent — if the iframe is "same-origin"). Perhaps in the future, if the spec is changed, this shall become available in Gecko, and then this can be revisited.

@RokeJulianLockhart RokeJulianLockhart changed the title Strips fragment at mail.proton.me. Strips fragment from parent document after generating link from content in iframe. Nov 14, 2024
@ichaoX
Copy link
Owner

ichaoX commented Nov 14, 2024

I've updated the link in #14 (comment); the one that was deleted might have been another similar issue.

Chrome does not allow creating links for <iframe> content, and the text fragment in the location bar will not work for <iframe>.

This extension provides additional compatibility and can create links for <iframe> content in some cases. It would be better if it could be distinguished in the menu.

@ichaoX ichaoX added the enhancement New feature or request label Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants