为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

Firefox copy-'n-paste of html isn't consistent accross platforms

  • 3 个回答
  • 2 人有此问题
  • 15 次查看
  • 最后回复者为 sirlark

more options

Firefox 31 doesn't copy and paste consistently across platforms, and never copy and pastes perfectly on any platform. I've tried various test cases always using a fresh install of firefox or a new profile and copying from the same web page.

Case 1: copy from FF 31 (fresh install) on windows 7 (VM) -> paste to MS Word 2007 on windows (VM)

 Pastes as a table with font formatting (bold is preserved) but no border lines or background colours come across

Case 2: copy from FF 31 (fresh install) on windows 7 (VM) -> paste to MS Word 2007 on Linux using Wine

 Pastes as plain text with the first rows cell each on a line on their own

Case 3: copy from FF 31 (new profile) on Linux -> paste to MS Word 2007 on windows (VM)

 Pastes as plain text with the first rows cell each on a line on their own

Case 4: copy from FF 31 (new profile) on Linux -> paste to MS Word 2007 on Linux using Wine

 Pastes as plain text with the first rows cell each on a line on their own

I realise there are likely issues cutting and pasting between a host and a VM, and also I know there are issues with cutting and pasting to programs running via wine on Linux (http://wiki.winehq.org/CopyAndPaste), but those are more to do with acquiring buffers/selections, rather then mime-types. Still even Case 1 isn't perfect. Chrome copies everything, colours, fonts, cell borders, etc perfectly. It seems that firefox isn't offering the right mime-type(s) for Word to recognise?

I'll try it with LibreOffice, which I am installing now.

Firefox 31 doesn't copy and paste consistently across platforms, and never copy and pastes perfectly on any platform. I've tried various test cases always using a fresh install of firefox or a new profile and copying from the same web page. Case 1: copy from FF 31 (fresh install) on windows 7 (VM) -> paste to MS Word 2007 on windows (VM) Pastes as a table with font formatting (bold is preserved) but no border lines or background colours come across Case 2: copy from FF 31 (fresh install) on windows 7 (VM) -> paste to MS Word 2007 on Linux using Wine Pastes as plain text with the first rows cell each on a line on their own Case 3: copy from FF 31 (new profile) on Linux -> paste to MS Word 2007 on windows (VM) Pastes as plain text with the first rows cell each on a line on their own Case 4: copy from FF 31 (new profile) on Linux -> paste to MS Word 2007 on Linux using Wine Pastes as plain text with the first rows cell each on a line on their own I realise there are likely issues cutting and pasting between a host and a VM, and also I know there are issues with cutting and pasting to programs running via wine on Linux (http://wiki.winehq.org/CopyAndPaste), but those are more to do with acquiring buffers/selections, rather then mime-types. Still even Case 1 isn't perfect. Chrome copies everything, colours, fonts, cell borders, etc perfectly. It seems that firefox isn't offering the right mime-type(s) for Word to recognise? I'll try it with LibreOffice, which I am installing now.

所有回复 (3)

more options

Hi, I just tried with LibreOffice on Linux, copying from FF 31 on the same OS, and it pastes similarly to Case 1, i.e it pastes as a table with font formatting (bold is preserved) but the font-face is not preserved, border lines are lost and no background colours come across.

So clearly FF is providing the right mime-type(s) but isn't actually conveying all the styling information.

more options

Firefox won't copy style rules that are applied from a style sheet to the clipboard. You only get inline style rules that were added via the style="" attribute.

more options

Thanks for the response, but I'm getting some styling (and it's all in CSS). For example the bolded text is specified in CSS, unless it's coming through purely because <th> tags are bold by default in Firefox.