tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 9a6741677ecef648e52df9ade4268493d8008d97
parent a24203b520808df4bfc0e464bcc03d1d59878b72
Author: agoloman <agoloman@mozilla.com>
Date:   Tue,  9 Dec 2025 17:53:35 +0200

Revert "Bug 2004502 - Text Fragments: Show "Copy Link to Highlight" context menu item if strip-on-share is disabled. r=Gijs" for causing bc failures @URLQueryStringStripper.cpp.

This reverts commit cad026ec7d15595fe06d164c6a3c9287341e3f34.

Diffstat:
Mbrowser/base/content/nsContextMenu.sys.mjs | 6++----
Mbrowser/base/content/test/contextMenu/browser_copy_link_to_highlight.js | 25-------------------------
2 files changed, 2 insertions(+), 29 deletions(-)

diff --git a/browser/base/content/nsContextMenu.sys.mjs b/browser/base/content/nsContextMenu.sys.mjs @@ -450,6 +450,7 @@ export class nsContextMenu { initTextFragmentItems() { const shouldShow = lazy.TEXT_FRAGMENTS_ENABLED && + lazy.STRIP_ON_SHARE_ENABLED && !( this.inPDFViewer || this.inFrame || @@ -458,10 +459,7 @@ export class nsContextMenu { ) && (this.hasTextFragments || this.isContentSelected); this.showItem("context-copy-link-to-highlight", shouldShow); - this.showItem( - "context-copy-clean-link-to-highlight", - shouldShow && lazy.STRIP_ON_SHARE_ENABLED - ); + this.showItem("context-copy-clean-link-to-highlight", shouldShow); // disables both options by default, while API tries to build a text fragment this.setItemAttr("context-copy-link-to-highlight", "disabled", true); diff --git a/browser/base/content/test/contextMenu/browser_copy_link_to_highlight.js b/browser/base/content/test/contextMenu/browser_copy_link_to_highlight.js @@ -304,31 +304,6 @@ add_task(async function removesAllHighlightsWithNonEmptyFragment() { ); }); -/* Bug 2004502: When strip_on_share is disabled, "Copy Link to Highlight" - * should still be visible but "Copy Clean Link to Highlight" should be hidden. - */ -add_task(async function copyLinkVisibleWhenStripOnShareDisabled() { - await SpecialPowers.pushPrefEnv({ - set: [["privacy.query_stripping.strip_on_share.enabled", false]], - }); - - await testCopyLinkToHighlight({ - testPage: loremIpsumTestPage(true), - runTests: async ({ copyLinkToHighlight, copyCleanLinkToHighlight }) => { - Assert.ok( - BrowserTestUtils.isVisible(copyLinkToHighlight), - "Copy Link to Highlight Menu item is visible when strip_on_share is disabled" - ); - Assert.ok( - !BrowserTestUtils.isVisible(copyCleanLinkToHighlight), - "Copy Clean Link to Highlight Menu item is not visible when strip_on_share is disabled" - ); - }, - }); - - await SpecialPowers.popPrefEnv(); -}); - /** * Creates a document which contains a contenteditable element with some content. * Additionally selects the editable content.