Closed Bug 1710289 Opened 3 years ago Closed 3 years ago

New tab on middle click vs paste into address bar

Categories

(Firefox :: Address Bar, defect, P2)

Firefox 88
defect
Points:
2

Tracking

()

VERIFIED FIXED
90 Branch
Iteration:
90.2 - May 3 - May 16
Tracking Status
firefox-esr78 --- unaffected
firefox88 --- wontfix
firefox89 --- wontfix
firefox90 --- verified

People

(Reporter: amade, Assigned: daisuke)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0

Steps to reproduce:

I clicked with middle mouse button on tab bar to open new tab.

Actual results:

New tab is opened and address bar is filled with paste buffer contents.

Expected results:

New tab should be opened and nothing should be pasted in tab bar

Now to expand onto the report... as fields are bit weird:

This is related to Linux and Middle Mouse Paste functionality (I don't think that other platforms use Middle Mouse Paste)

I also tried it with a new empty profile, behaviour is the same.
Setting "middlemouse.paste" in "about:config" stops this behaviour, but this is not, what I want.
Feels to me that it starts happening after longer piece of text is selected, if I select single character, I haven't observed this behaviour.
This started happening in recent versions...

As for the use case:
I like to highlight text when I read with mouse to not lose my position in text, but I don't want it to be pasted into address bar when I try to create new tab, by clicking with Middle Mouse Button onto Tab Bar. I still want to be able to use Middle Mouse Paste to paste into Address Bar and Text Boxes, when I explicitly click them.

Also I guess that people that have search suggestions enabled may not want some random text to be searched for...

So I also decided to download official releases and run few quick tests:
86 - Seems to work as expected
87, 88 - Behaviour is broken
Which seems to align with the fact that it seems to have started happening recently.

The Bugbug bot thinks this bug should belong to the 'Firefox::Address Bar' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Address Bar

And with mozregression narrowed to following:

9:35.25 INFO: Narrowed integration regression window from [81bec1bb, c27aac8c] (3 builds) to [81bec1bb, 22e706c2] (2 builds) (~1 steps left)
9:35.25 INFO: No more integration revisions, bisection finished.
9:35.25 INFO: Last good revision: 81bec1bb5b4e34a819dc9159b194f1896edd2436
9:35.25 INFO: First bad revision: 22e706c2ff1d4469907bc44c8c1bc256512553e7
9:35.25 INFO: Pushlog:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=81bec1bb5b4e34a819dc9159b194f1896edd2436&tochange=22e706c2ff1d4469907bc44c8c1bc256512553e7

Seems like related commits touch paste code, which could explain the problem.

Testing it a bit more seems to be somehow caused by https://hg.mozilla.org/integration/autoland/rev/e4a60e1d9ef527ebc960f7ebc589b24e9d7681b1
I reverted the code in browser/components/urlbar/UrlbarInput.jsm to state before this patch and creating new tabs works as I would expect.

Flags: needinfo?(daisuke)

Thank you very much for your reporting, Amadeusz!
Yes, I also could reproduce this issue on current Nightly as well.
I will take a look at this bug.

Flags: needinfo?(daisuke)
Assignee: nobody → daisuke
Status: UNCONFIRMED → ASSIGNED
Iteration: --- → 90.2 - May 3 - May 16
Points: --- → 2
Ever confirmed: true
Priority: -- → P2

Just information.
This problem happens when clicking the middle mouse button on the new tab button as well.

So I applied it against 88 which comes from my distribution and spend day with it.

It mostly works, but I noticed one more corner case:
If I quickly double click in tab bar in area where new tab should appear it still occasionally pastes content.
Seems like it happens when animation for new tab hasn't finished.

Thank you so much for confirming, and reporting another issue!
Yes, I also could reproduce it, will fix it.

Pushed by dakatsuka.birchill@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8a78072a547d
Avoid pasting the content of clipboard to urlbar upon clicking on new tab button and tab bar. r=masayuki,adw
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch

Hi,
I've verified that this has been fixed on the latest nightly but that this bug is present on Beta 89.0b10.

Regards, Flor.

Status: RESOLVED → VERIFIED
Has Regression Range: --- → yes

Should we consider uplifting this to Beta?

Flags: needinfo?(daisuke)

Comment on attachment 9221033 [details]
Bug 1710289: Avoid pasting the content of clipboard to urlbar upon clicking on new tab button and tab bar.

Beta/Release Uplift Approval Request

  • User impact if declined: When user middle click on tab bar or new tab button, the content of clipboard will be pasted unexpectedly.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): The main changes are a few codes and already verified by QA.
  • String changes made/needed: none
Flags: needinfo?(daisuke)
Attachment #9221033 - Flags: approval-mozilla-beta?

Comment on attachment 9221033 [details]
Bug 1710289: Avoid pasting the content of clipboard to urlbar upon clicking on new tab button and tab bar.

We shipped 87 and 88 with this bug, it recently landed on nightly and we are nearing the beta cycle, I think it should ride the 90 train, thanks.

Attachment #9221033 - Flags: approval-mozilla-beta? → approval-mozilla-beta-
See Also: → 1418462
See Also: → 1838743
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: