Closed Bug 1974126 Opened 7 months ago Closed 6 months ago

Unable to Copy Link to Highlight when a highlight is already applied

Categories

(Firefox :: Menus, defect)

defect

Tracking

()

VERIFIED FIXED
143 Branch
Tracking Status
firefox143 --- verified
firefox144 --- verified

People

(Reporter: Dasha, Assigned: jjaschke)

References

Details

Attachments

(2 files)

🐞 Steps to Reproduce:

  • Open Firefox Nightly 142+
  • Visit a page and activate an existing link to highlight
  • Right-click directly on the already-highlighted text
  • Look for “Copy Link to Highlight” in the context menu

❌ Current Behaviour:
If a highlight is already applied, the “Copy Link to Highlight” option is not available in the context menu.
This makes it hard for users to re-copy or share a highlight once it's visible — they’re forced to make a brand new manual text selection first, which isn’t intuitive. This also is out of alignment with the UX spec provided last October.

💡 Expected Behaviour:
Users should be able to right-click an existing highlight and copy it again without needing to re-select the text manually.
This interaction should feel seamless — if a visible highlight is active, the context menu should still offer the CLTH option as expected.

Summary: Unable to Copy Link to Highlight (CLTH) when a highlight is already applied → Unable to Copy Link to Highlight when a highlight is already applied
Type: enhancement → defect
See Also: → 1948471

Other browsers provide the "copy link to highlight" context menu entry if the user right-clicks
onto an existing highlight (without selection). In this case, the created link contains all highlights
on the page. If a selection exists as well, it should take precedence.

This patch adapts to this behavior. When the context menu is opened, it is determined
whether there is a selection or an existing highlight range at the given point.
This has the side-effect that the "Copy Link to Highlight" option only shows up
if the user right-clicks on a selection or an existing highlight, but not anywhere else
(this also aligns behavior to Chrome).

Assignee: nobody → jjaschke
Status: NEW → ASSIGNED
Pushed by ctodea@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/93904aec9c2c https://hg.mozilla.org/integration/autoland/rev/8e3cb916ac15 Revert "Bug 1974126 - Text Fragments: Allow users to copy an existing highlight. r=Gijs,webidl,emilio" for causing mochitests failures

Backed out for causing mochitest failures

- backout link
- push with failures
- failure log
- failure log

Flags: needinfo?(jjaschke)
Flags: needinfo?(jjaschke)
Pushed by agoloman@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/ca18a6d9e19f https://hg.mozilla.org/integration/autoland/rev/f82b4f4ce73a Revert "Bug 1974126 - Text Fragments: Allow users to copy an existing highlight. r=Gijs,webidl,emilio" for causing bc failures @browser_contextmenu.js.

Backed out for causing bc failures @browser_contextmenu.js.

Flags: needinfo?(jjaschke)

Three time's the charm...

Flags: needinfo?(jjaschke)

Adding this to our QA scope for Nightly 143, wasn't ware of it.

Flags: qe-verify+
Flags: in-qa-testsuite?(aflorinescu)
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 143 Branch
QA Contact: oardelean
QA Whiteboard: [qa-triage-done-c144/b143] [qa-ver-needed-c144/b143]

Reproducible on a 2025-06-25 Firefox Nightly build on Windows 10.

Verified as fixed on Firefox Nightly 144.0a1 and Firefox 143.0b1(with dom.text_fragments.create_text_fragment.enabled set on true) on Windows 10, Ubuntu 22, macOS 15.

‘Copy Link to Highlight’ and ‘Copy Clean Link to Highlight’ options are visible in the context menu when selecting an already-existing highlighted fragment.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-triage-done-c144/b143] [qa-ver-needed-c144/b143] → [qa-triage-done-c144/b143] [qa-ver-done-c144/b143]
Regressions: 1986373
Flags: in-qa-testsuite?(aflorinescu)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: