Open Bug 1703329 Opened 5 years ago Updated 3 years ago

After selecting a text, right-clicking and Copy, sometimes the text doesn't get to clipboard

Categories

(Core :: DOM: Copy & Paste and Drag & Drop, defect, P3)

Firefox 87
defect

Tracking

()

People

(Reporter: alexandru_something, Unassigned)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Firefox/87.0

Steps to reproduce:

Select a text, right-click, Copy
(try it for several times)

Actual results:

For a few times (like 1 in 5) the selected text doesn't get to the clipboard

Expected results:

The text should have been copied to the clipboard!

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

Component: Untriaged → DOM: Selection
Product: Firefox → Core

Mirko, does this look actionable as reported?

Flags: needinfo?(mbrodesser)

Couldn't reproduce the issue on Ubuntu 20.04 with text from https://bugzilla.mozilla.org/show_bug.cgi?id=1703329#c0.

:AlexL: can you please provide a concrete example? A minimal test-file and which text to select there would be ideal. Moreover, how do you check the text is not copied onto the clipboard? Please provide as much information as possible.

Flags: needinfo?(mbrodesser) → needinfo?(alexandru_something)

For example:

https://thetvdb.com/series/supergirl/allseasons/official

Try to copy from this page, episode summaries for at least 10 episodes in a row to Notepad (1 by 1).
You will see duplicates (since the Copy didn't work for some times). That's how I discovered the bug.
Try it many times and it will fail eventually.

I'm using latest Firefox & Windows 10.

Flags: needinfo?(alexandru_something)

I'm using now the combination Ctrl-C, Ctrl-V, which never faied.

First, I thought it was a hardware issue with my mouse :) Tried with another mouse, same bug.

The bug shows on repetition.

Hope this info will help to reproduce it,
AlexL.

Note: I tried the Supergirl summaries to notepad and the bug didn't show.

So I will explain exactly what I do: (when this occurs)
I have 2 Firefox windows on my screen (half and half). On the 1st I have opened a site tvmaze.com, on the other tvdb.com.
I'm trying to add missing summaries for some shows from tvdb to tvmaze, so on the left I have an episode with missing summaries, on the right I have all the summaries to all the episode.
I'm on the 2nd page (tvdb), I double click a summary to select it, right click > Copy, go to the 1st page to the summary box, right click, Paste. Then I click Update. And so on...

This could happen while 1st windows is still loading and I'm already in the 2nd window selecting and right-clicking and click on Copy.

(In reply to AlexL from comment #6)

Note: I tried the Supergirl summaries to notepad and the bug didn't show.

So I will explain exactly what I do: (when this occurs)
I have 2 Firefox windows on my screen (half and half). On the 1st I have opened a site tvmaze.com, on the other tvdb.com.
I'm trying to add missing summaries for some shows from tvdb to tvmaze, so on the left I have an episode with missing summaries, on the right I have all the summaries to all the episode.
I'm on the 2nd page (tvdb), I double click a summary to select it, right click > Copy, go to the 1st page to the summary box, right click, Paste. Then I click Update. And so on...

What exactly happens on paste? Is nothing pasted, is pasted what was copied before?

If you open data:text/html,<div contentediable>X</div> in one Window, and paste to that one, does the issue occur too?

This could happen while 1st windows is still loading and I'm already in the 2nd window selecting and right-clicking and click on Copy.

It is pasted what was copied before.

https://www.youtube.com/watch?v=LPGSpBcH0SA

Here is a screen cap of what is happening.... as you can see at the end... when I paste it's not the last text I copied, it's the one before.

(In reply to AlexL from comment #8)

It is pasted what was copied before.

Thanks; also for the screen cap.

Could you please check what's mentioned in #c7? This could help to determine if it's a website-specific issue or not.

Does the issue also occur with Chrome?

Couldn't paste in that window.

Tried with a div example

and the issue didn't occur.... will also check with Chrome.

On Chrome it doesn't occur using right click > Copy > Paste.

But it's very weird, on Firefox it only occurs with right click > Copy > Paste. If I use the shortcuts Ctrl-C, Ctrl-V, everything is ok!
Why? :)

Severity: -- → S3
Priority: -- → P3

This is happening to me as well, starting after an update to Firefox 89.0 64-bit for Intel macOS 10.15.7. Copy fails for Command+C and the Edit menu, but the contextual menu (Control+click on the selection) has succeeded so far. It may take several attempts for the copy to finally work, so it is an intermittent problem. I've only noticed it happening within a secondary <iframe> which is filled dynamically with raw text (text/plain, UTF-8). (Web page is private to our company, so I can't share it, sorry.)

Maybe it is some sort of focus problem? The context menu Control+click does require an extra click in the frame compared to the other methods.

(In reply to Ian Osgood from comment #15)

This is happening to me as well, starting after an update to Firefox 89.0 64-bit for Intel macOS 10.15.7. Copy fails for Command+C and the Edit menu, but the contextual menu (Control+click on the selection) has succeeded so far. It may take several attempts for the copy to finally work, so it is an intermittent problem. I've only noticed it happening within a secondary <iframe> which is filled dynamically with raw text (text/plain, UTF-8). (Web page is private to our company, so I can't share it, sorry.)

Maybe it is some sort of focus problem? The context menu Control+click does require an extra click in the frame compared to the other methods.

Noticed another thing: after I select the text, sometimes the Copy option on the contextual menu is disabled....
This copy-paste issue only happens between two firefox different windows (one is private). When I copy from Firefox to a Chrome page this issue does not appear. Very strange.

Without being able to reproduce the issue, I don't know how to fix this.

Perhaps, I sometimes reproduced this unless I did mistakes every time in the cases. Additionally, some tests using clipboard does not pass in my environment high frequently. So, I could debug it from the testing issue first. But I don't have much time for now...

(In reply to Mirko Brodesser (:mbrodesser) from comment #17)

Without being able to reproduce the issue, I don't know how to fix this.

Would a TeamViewer control help?

(In reply to AlexL from comment #19)

(In reply to Mirko Brodesser (:mbrodesser) from comment #17)

Without being able to reproduce the issue, I don't know how to fix this.

Would a TeamViewer control help?

Thanks for the offer, presumably not. In order to fix it, ideally, it would be reproducible on Linux, too. I'll ask someone to try to reproduce it on Linux and Windows.

Component: DOM: Selection → DOM: Copy & Paste and Drag & Drop

I had no luck reproducing this on Windows 10 on the latest Firefox Release 90.0.1 by following the steps from the attached screen recording.
AlexL, could you please try to install the Clipboard Manager addon and see if your copied items appear there as well when you do copy them? Please also make sure to increase the number of items to keep in memory so you won't run out of space.

If you have the time, could you please also try out mozregression and see if you can get a pushlog for what might have caused this on your side? Mozregression info:https://mozilla.github.io/mozregression/install.html

Edit: This could not be reproduced on Ubuntu either.

Flags: needinfo?(alexandru_something)

(In reply to Timea Cernea [:tbabos] from comment #21)

I had no luck reproducing this on Windows 10 on the latest Firefox Release 90.0.1 by following the steps from the attached screen recording.
AlexL, could you please try to install the Clipboard Manager addon and see if your copied items appear there as well when you do copy them? Please also make sure to increase the number of items to keep in memory so you won't run out of space.

If you have the time, could you please also try out mozregression and see if you can get a pushlog for what might have caused this on your side? Mozregression info:https://mozilla.github.io/mozregression/install.html

Edit: This could not be reproduced on Ubuntu either.

I've installed the Clipboard Manager addon. I tried to reproduce the bug (without actually update the episode summaries - by pressing Update, just paste in the edit box the text) and all went fine. So the bug occured only when copying from a page while the other page was loading.

I will try that tomorrow to see if the bug is still there.

Flags: needinfo?(alexandru_something)

I can confirm that the bug appeared again, and no text (that was selected/ right clicked / copied) was to be found in the Clipboard Manager. It's like I never did the Copy action. This of course happened while the 1st window was updating/reloading, with the Copy action in the second window.

Another user pointed out a question if this could be a "focus problem". Sometimes when I right clicked on a selected text I even got the Copy option disabled (gray). This is very weird and happens only when I do things very fast.

I'm on latest Firefox (at this date) v 91.0.1. Using Windows 10 on a DELL Laptop - i5 (1st gen), 8GB RAM, HDD (no SSD)

Today, I meet this situation... Failing Ctrl+C may be caused by this.

(In reply to Masayuki Nakano [:masayuki] (he/him)(JST, +0900) from comment #24)

Created attachment 9237327 [details]
Copy command is disabled when there is non-collapsed selection

Today, I meet this situation... Failing Ctrl+C may be caused by this.

Perhaps the Copy button and potentially Ctrl+c rely on some cached Selection (https://searchfox.org/mozilla-central/search?q=cache.*selection&path=&case=false&regexp=true)?

In theory, enabling logging could help to narrow down the bug. In practice, there's currently no helpful logging for this scenario, as can be seen by checking https://searchfox.org/mozilla-central/search?q=LazyLogModule.*clipboard&case=true&regexp=true&path= and the related loggers.

(In reply to Timea Cernea [:tbabos] from comment #21)

I had no luck reproducing this on Windows 10 on the latest Firefox Release 90.0.1 by following the steps from the attached screen recording.
AlexL, could you please try to install the Clipboard Manager addon and see if your copied items appear there as well when you do copy them? Please also make sure to increase the number of items to keep in memory so you won't run out of space.

I installed Clipboard Manager as well. When I triggered the bug (still happening in 90.0.2), sure enough, the selected text did not appear on the clipboard stack. However, after successfully copying and pasting from the same window (using the contextual menu, which has always worked for me), the data still did not appear on the Clipboard Manager stack. (On the other hand, maybe Clipboard Manager is stuck. The top item is "[object Object]" and has not changed even after several successful copy-paste operations.)

Tried to reproduce this on Windows with the steps described in #c4. No success.

(In reply to Masayuki Nakano [:masayuki] (he/him)(JST, +0900) from comment #18)

Perhaps, I sometimes reproduced this unless I did mistakes every time in the cases. Additionally, some tests using clipboard does not pass in my environment high frequently. So, I could debug it from the testing issue first. But I don't have much time for now...

Masayuki: which are those tests? I'd try if they fail on my Windows system too.

Flags: needinfo?(masayuki)

Are there legal cases when the Copy button should be grayed out? In case there's no selection, right-click also doesn't show a Copy button.
Dão: can you point to the relevant code?

Flags: needinfo?(dao+bmo)

Could be a duplicate of bug 1726269, which seems easier to debug.

I think that all of them are contained in bug 1726423.

Flags: needinfo?(masayuki)
Status: UNCONFIRMED → NEW
Ever confirmed: true

AlexL, Ian Osgood: bug 1726269 fixed some broken copy-paste functionality on Windows. It might've fixed this bug, too. If you want to test the fix, it'll be in Firefox Nightly tomorrow.

Depends on: 1726269
See Also: 1726269

(In reply to Mirko Brodesser (:mbrodesser-Igalia) from comment #33)

AlexL, Ian Osgood: bug 1726269 fixed some broken copy-paste functionality on Windows. It might've fixed this bug, too. If you want to test the fix, it'll be in Firefox Nightly tomorrow.

This behavior is still there for me on the Mac, still intermittent. Currently using build 113.0b5 on macOS 12.4

(btw, the Clipboard Manager extension is not a reliable way to test this. It often will not register the last copy operation, even if it is present on the system Clipboard.)

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: