Join the AMA (Ask Me Anything) with the Firefox leadership team to celebrate Firefox 20th anniversary and discuss Firefox’s future on Mozilla Connect. Mark your calendar on Thursday, November 14, 18:00 - 20:00 UTC!

본 사이트는 여러분의 사용자 경험을 개선하기 위해 유지 보수를 진행하는 동안 기능이 제한됩니다. 도움말로 문제가 해결되지 않고 질문을 하고 싶다면 Twitter의 @FirefoxSupport 및 Reddit의 /r/firefox 채널을 활용하세요.

Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

자세히 살펴보기

Copy/paste add extra space

more options

Hi, When I copy and paste text from the web, a white space is always added to the beginning of the pasted text. What is the reason?

Hi, When I copy and paste text from the web, a white space is always added to the beginning of the pasted text. What is the reason?

모든 댓글 (12)

more options

I think that will vary based on what you are copying from and how you selected it.

For example, I notice sometimes when I copy text from a table that Firefox will include the table cell boundary. In MS Word this shows up as a tab character, and when pasting into a web form, it may show up as a space.

When copying text, I find the most precise way to select to be:

  • To select a paragraph, triple-click.
  • To select more than a paragraph, select the first paragraph, then Shift+click at the end of the range I want to select.
  • To select less than a paragraph, double-click the first word, then Shift+click at the end of the range I want to select.

Not sure whether that will work for the page you're copying from.

more options

My problem is the double click. When i double click, copy and paste, the extra space appear

more options

I use an add-on that copies only plain text.

Go to the Mozilla Add-ons Web Page {web Link} (There’s a lot of good stuff here) and search for what you want.

more options

mauroponcia said

My problem is the double click. When i double click, copy and paste, the extra space appear

I don't know whether it would help to change this setting, since I think it only refers to the space after a word you double-clicked, but you could try it:

(1) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button promising to be careful or accepting the risk.

(2) In the search box above the list, type or paste select and pause while the list is filtered

(3) Double-click the layout.word_select.eat_space_to_next_word preference to switch the value from true to false

Does that make any difference?

more options

FredMcD said

I use an add-on that copies only plain text. Go to the Mozilla Add-ons Web Page {web Link} (There’s a lot of good stuff here) and search for what you want.


Yes, there is a lot of stuff. Which one do you use?

글쓴이 mauroponcia 수정일시

more options

jscher2000 said

mauroponcia said
My problem is the double click. When i double click, copy and paste, the extra space appear

I don't know whether it would help to change this setting, since I think it only refers to the space after a word you double-clicked, but you could try it:

(1) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button promising to be careful or accepting the risk.

(2) In the search box above the list, type or paste select and pause while the list is filtered

(3) Double-click the layout.word_select.eat_space_to_next_word preference to switch the value from true to false

Does that make any difference?

Nothing has changed

more options

FredMcD said

I use an add-on that copies only plain text.

mauroponcia said

Yes, there is a lot of stuff. Which one do you use?

Copy As Plain Text Not compatible with Firefox Quantum

more options

Yesterday I double-clicked something and I could see that in addition to the word, something to the left of it was selected. However, I've lost track of what site that was. Can you post some examples as you come across them? What I think might be interesting is to right-click > View Selection Source to see what Firefox is including as part of the "word" in that case. (The source code should show the corresponding selection in the underlying HTML.)

more options

jscher2000 said

Yesterday I double-clicked something and I could see that in addition to the word, something to the left of it was selected. However, I've lost track of what site that was. Can you post some examples as you come across them? What I think might be interesting is to right-click > View Selection Source to see what Firefox is including as part of the "word" in that case. (The source code should show the corresponding selection in the underlying HTML.)

This is a double click. As you can see it select space in the left . This problem does not happen anywhere. Sometimes it seems there are some texts that firefox does not like. I use Firefox Quantum

글쓴이 mauroponcia 수정일시

more options

Hi mauroponcia, thank you for that example. Because browsers ignore extra blank space, tabs, and line breaks when displaying text on screen, developers can be a little careless about the HTML.

I don't know off the top of my head how to exclude that extra whitespace from the "word" selection using any built-in features. Hopefully someone else will have an idea for that, or know of a convenient add-on that works in current releases.

more options

I don't know.. With Chrome I've never seen this problem/bug. I Will wait for an extension

more options

When I look in the bug tracking system, there seem to be a few old issues related to selecting space(s) or even the word prior to the word you double-clicked, depending on the structure of the page.

I think what might help is a script that "normalizes" the white space in that part of the page (in the <li>) by collapsing tabs and line breaks and spaces down to a single space. For example:

var tnli = document.evaluate('.//text()[(ancestor::li)]', 
  document.body, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); 
for (var i=0, len=tnli.snapshotLength; i<len; i++){
  var tn=tnli.snapshotItem(i); 
  tn.nodeValue = tn.nodeValue.replace(/\s+/g, ' ');
}

You can install the script as a bookmarklet, on your Bookmarks Toolbar or Bookmarks Menu, and run it from there. I added it to my page here:

https://www.jeffersonscher.com/res/sumomarklets.html#normli

You'll need to click the button after loading the page and before the first time you double-click to select. If the page auto-loads more results, you'll need to click the button it again. There probably are ways to make it more convenient depending on how you use the site.

If you try it out, let me know how it works for you.