Copy A Large Text From Chrome Browser

Just to have more context: paste in the Chrome browser itself (webmail), or in a client (Thunderbird, Evolution)?

1 Like

I was able to paste the contents into the webmail, not in a client. In other words, the contents do not leave the browser.

Make sure the text is copied correctly to the clipboard.

  • Try using some clipboard manager like GPaste.

  • Try copy-paste with primary selection: Ctrl+A, Middle click

this does not work. I tried the same operation on my windows machine, and it worked very well.

Is it possibly a bug on Fedora 32?

I created a file containing 8000 lines of random words and I opened it with Chrome. And copy&paste from Chrome to Gedit works.
I created a file containing 8000 lines with the example text you wrote in the first post, and I can reproduce the fact that copy&paste from Chrome doesn’t work. Looking at gpaste history, the copied text doesn’t even go to the clipboard, and at the same time the clipboard is empty.
However copy&paste works if I open the file using Firefox.


Do you think this is a Chrome bug?

It’s possible.

Actually, I can reproduce the issue with Chromium Freeworld for both Wayland and Xorg.

1 Like

I would not know what is different between systems, but i am using F32, with kernel 5.8.7, gnome 3.36.6-1.fc32 gedit 2:3.36.2-1.fc32 and chrome 85.0.4183.102-1
I tried what alciregi did but used a file that I created using vim. I pasted 41,926 copies of the line posted by yifan in his first post into that file then saved it.
I then opened that file with chrome, copied the entire contents into the clipboard and pasted it into gedit which I then saved to a new file. I had no problems copying/pasting from chrome or gedit.

I wonder how much memory is installed in yifan’s and alciregi’s PCs. I have 16GB and had no problems, but I can see where inadequate memory and needing to use swap might interfere, especially when doing a copy/paste.

1 Like

My computer has got 32 GB RAM installed. So, I also reproduced @alciregi’s attempt:

  1. I copied the one line from here, opened gVim and made 40000 copies into the opened file. Then saved it without any issues. gVim was super fast in doing this.
  2. Then I opened the file in Firefox, it complained about some JSON compatibility error - it probably expected one big JSON and not 40000 small JSONs - but I could copy it and paste into Gedit with no issues. It just was not that quick as with gVim.
  3. I did the same with Chrome. Chrome did not complain about anything, but loading the file took more than a minute. Then it could be copied using the right click and Copy, but when I wanted to paste it into Gedit, there was nothing in the clipboard.

So, I can confirm that this is not a Gnome, or clipboard issues, that must be a Chrome issue. The question is, whether it might be actually a feature that protects the system from being overloaded with huge files?

According to this discussion, Clipboard setData Chrome limit - Adobe Support Community - 8281407, it seems like there is some sort of a limit in Google Chrome. Unfortunately, I have not been able to find a solution to it.

Either you can use Firefox to copy those data, because this has proven working.
Or you could download the whole page with wget or curl.

So, what is different on your system, that you can copy that chunk of files, @computersavvy ?

Here’s a way to reproduce the issue:

printf x%.s $(seq $((2**18+1))) > /tmp/x.txt; \
chromium-freeworld /tmp/x.txt

256K is not enough for anyone. :rofl: @chromium-2020

My desktop has 128 GB Ram. Does your result mean vim is more powerful than geany and vim?

1 Like

No, with 128 GB RAM you probably do not have to worry about what application you will use, whether vim, gvim, geany, or gedit.
However, from what I have experienced (never measured anything though), vim is faster than gedit when dealing with lots of lines, but you need to know your way around it. To see vim for the first time could cause you severe headaches :smiley: .

I have no clue what is different, but it worked for me.
I just repeated the test, with new files.

first, using vi I created one file (test-it) into which I pasted 40,001 copies of the line given, and saved it.
I then opened that file in chrome, highlighted all the opened file, as seen in this image, and using ctrl-c copied it to the clipboard.

I then opened a new file with gedit (testit) and pasted the entire clipboard content into it using ctrl-v and saved it. As you can see from the next image there were 40,001 lines with 320 columns in the file.

It took some scrolling (and time) in chrome to reach the last line of the file but once done everything worked. Due to the size of the content gedit also took a few seconds to display and save the file, but other than time needed simply due to the volume of the content everything worked well.

vim is definitely faster than gedit for large files, but as has been said, you need to spend a little time to learn it’s power to effectively use it.

This issue has nothing to do with text editors, number of lines or columns.
It can be easily reproduced with 2^18+1 characters that is 256K+1 bytes.

1 Like

That may be a unique spot where it fails, but my test with 40,000 copies of the line originally posted produces a file with 13M size and it does not fail in opening up with chrome nor copy/paste functions. The OP said he had about 40,000 lines similar to what was posted and it failed for him.
I wonder if there is a range of size where it fails and then is ok again when it is larger.

$ ls -lh
-rw-rw-r--.   1 user user  13M Sep 15 09:39  test-it
-rw-rw-r--.   1 user user  13M Sep 15 09:45  testit

$ ls -l
-rw-rw-r--.   1 user user 12880322 Sep 15 09:39  test-it
-rw-rw-r--.   1 user user 12880322 Sep 15 09:45  testit

$ wc -l < testit

The OP may be confusing Chrome and Chromium.
I can reproduce the issue with chromium-freeworld.

I didn’t confuse chrome with chromium. I am using chrome at f32

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.