Closed Bug 1838743 Opened 10 months ago Closed 9 months ago

Data in X Primary Selection is pasted in the address bar when middle-click is used to open bookmark in new tab

Categories

(Firefox :: Address Bar, defect)

Firefox 114
Unspecified
Linux
defect

Tracking

()

RESOLVED FIXED
117 Branch
Tracking Status
firefox-esr102 --- wontfix
firefox-esr115 --- wontfix
firefox114 --- wontfix
firefox115 --- wontfix
firefox116 --- wontfix
firefox117 --- fixed

People

(Reporter: leealwc, Assigned: daisuke)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

UA: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0

The issue looks similar to bug 1696974, but appears to be different issues as bug 1696974 seems to be fixed already but this one is still reproducible.

The issue appears to happen when there are content in the X Primary Selection buffer, and the content contains newline character.

Steps to reproduce:

  1. Select some text including newline character, to put them into the X Primary Selection buffer. The xclip utility can be used to demonstrate the issue (the \n seems to be necessary to reproduce the issue):
    echo -e "xyz\n" | xclip -r

  2. In Firefox, open a New Tab. Let the focus stay in the address bar.

  3. Middle-click on a bookmark (to open it in a new tab)

Expected result:

  • The bookmark to open in a new tab.
  • No change in the "New Tab" tab.

Actual result:

  • The bookmark opened in a new tab.
  • In the "New Tab" tab, "xyz " is pasted into the address bar.

I also think it could become a privacy issue if search engine suggestion is enabled.

I can reproduce this for bookmarks in the menubar and the toolbar but it is intermittent. Middle-clicking an empty part of a toolbar when a new tab is open does the same thing and is consistently reproducible. Pasting should only occur when middle-clicking inside the address bar.

Regression window:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=5f0f6477c734369a72fec1211b608eb14d33bd4a&tochange=db7158dfb86d26ee055be75542446811d0fbb572

Possibly regressed by Bug 1327589.

:daisuke, since you are the author of the regressor, bug 1327589, could you take a look?

For more information, please visit BugBot documentation.

Flags: needinfo?(daisuke)
Assignee: nobody → daisuke
Status: NEW → ASSIGNED
Flags: needinfo?(daisuke)

Set release status flags based on info from the regressing bug 1327589

Pushed by dakatsuka.birchill@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/909fc50c54a1
Ignore paste event if the event was fired from not urlbar r=masayuki,dao

Backed out for causing failures on browser_947914_button_paste.js

Backout link

Push with failures

Failure log
Failure log 2

Flags: needinfo?(daisuke)
Attachment #9342542 - Attachment description: Bug 1838743: Ignore paste event if the event was fired from not urlbar → Bug 1838743: Avoid firing paste event when middle-clicking on not editor in Chrome document
Pushed by dakatsuka.birchill@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4a83c278a04d
Avoid firing paste event when middle-clicking on not editor in Chrome document r=masayuki,dao
Status: ASSIGNED → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → 117 Branch
Flags: needinfo?(daisuke)

The patch landed in nightly and beta is affected.
:daisuke, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox116 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(daisuke)
Flags: needinfo?(daisuke)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: