Mozilla VPN is currently experiencing an outage. Our team is actively working to resolve the issue. Please check the status page for real-time updates. Thank you for your patience.

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

搜索 | 用户支持

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

详细了解

A page element is not copied

  • 5 个回答
  • 2 人有此问题
  • 1 次查看
  • 最后回复者为 dopadapo

more options

Halo, Firefox Users.

Firefox 22.0 on Windows7.

I have seen this issue for such a long time. Is this a bug ?

Please, visit this site by using Firefox.

http://answers.microsoft.com/en-us/office/forum/office_2010-onenote/onenote-linked-notes-window-is-docking-on-top-of/6631da0a-447b-437d-b2fa-efe99c919870

Please, do right-click and select "Select All", then right-click and select "Copy".

Paste the copied elements as plain-text onto any text editor.


I see that all dates are not copied. In the text that I paste, I see:

"… asked on ..." (no date)

"… replied on ..." (no date)


If I use MS-InternetExplorer, the pasted text has:

"… asked on

July 15, 2010 ..."


"… replied on

September 4, 2010 ..."

… and so on.

Thank you.

Halo, Firefox Users. Firefox 22.0 on Windows7. I have seen this issue for such a long time. Is this a bug ? Please, visit this site by using Firefox. http://answers.microsoft.com/en-us/office/forum/office_2010-onenote/onenote-linked-notes-window-is-docking-on-top-of/6631da0a-447b-437d-b2fa-efe99c919870 Please, do right-click and select "Select All", then right-click and select "Copy". Paste the copied elements as plain-text onto any text editor. I see that all dates are not copied. In the text that I paste, I see: "… asked on ..." (no date) "… replied on ..." (no date) If I use MS-InternetExplorer, the pasted text has: "… asked on July 15, 2010 ..." "… replied on September 4, 2010 ..." … and so on. Thank you.

由dopadapo于修改

被采纳的解决方案

Hello, it's an unusual layout. The username is the display text of a link, but the date is the text of a button, although it is styled just like the username so this difference is not obvious:

<a href="http://answers.microsoft.com/en-us/profile/b7195fc2-0525-4652-973a-02ce0e415bf6">shadow49</a>
asked on
<div>
 <button>July 15, 2010</button>

Why doesn't Firefox include the text of buttons in its "plain text"? I don't know...


As a temporary workaround, you could convert the buttons to plain text using a snippet of script. Here's how:

(1) On the page, open the web console by pressing Ctrl+Shift+k

(2) Paste the following long line of code next to the caret (">") and press Enter to run it:

while(document.getElementsByTagName("button").length > 0){ but = document.getElementsByTagName("button")[0]; var txt = but.textContent; if(txt){ if(txt.length>0) but.parentNode.replaceChild(document.createTextNode(txt), but); else but.parentNode.removeChild(but);} else but.parentNode.removeChild(but);}

(3) Close the web console by pressing Ctrl+Shift+k


That isn't very convenient, but it could be automated a bit by creating a bookmarklet. Here's how.

First, copy this slightly modified script (select, Ctrl+c):

javascript: while(document.getElementsByTagName("button").length > 0){ but = document.getElementsByTagName("button")[0]; var txt = but.textContent; if(txt){ if(txt.length>0) but.parentNode.replaceChild(document.createTextNode(txt), but); else but.parentNode.removeChild(but);} else but.parentNode.removeChild(but);} void 0;

Next, if you are not displaying the Bookmarks Toolbar, you can display it using either:

  • right-click a blank area of the tab bar > Bookmarks Toolbar
  • tap the Alt key > View menu > Toolbars > Bookmarks Toolbar

Right-click on the Bookmarks Toolbar and choose New Bookmark.

Paste the code into the Location box (the second box).

Then type a useful name in the Name box (e.g., Btn2Txt) and click Add.

Now, when you want to hack the buttons in the page, click the bookmark to run the script.

定位到答案原位置 👍 1

所有回复 (5)

more options

happens to me too maybe it is a bug? you can file one at bugzilla

more options

选择的解决方案

Hello, it's an unusual layout. The username is the display text of a link, but the date is the text of a button, although it is styled just like the username so this difference is not obvious:

<a href="http://answers.microsoft.com/en-us/profile/b7195fc2-0525-4652-973a-02ce0e415bf6">shadow49</a>
asked on
<div>
 <button>July 15, 2010</button>

Why doesn't Firefox include the text of buttons in its "plain text"? I don't know...


As a temporary workaround, you could convert the buttons to plain text using a snippet of script. Here's how:

(1) On the page, open the web console by pressing Ctrl+Shift+k

(2) Paste the following long line of code next to the caret (">") and press Enter to run it:

while(document.getElementsByTagName("button").length > 0){ but = document.getElementsByTagName("button")[0]; var txt = but.textContent; if(txt){ if(txt.length>0) but.parentNode.replaceChild(document.createTextNode(txt), but); else but.parentNode.removeChild(but);} else but.parentNode.removeChild(but);}

(3) Close the web console by pressing Ctrl+Shift+k


That isn't very convenient, but it could be automated a bit by creating a bookmarklet. Here's how.

First, copy this slightly modified script (select, Ctrl+c):

javascript: while(document.getElementsByTagName("button").length > 0){ but = document.getElementsByTagName("button")[0]; var txt = but.textContent; if(txt){ if(txt.length>0) but.parentNode.replaceChild(document.createTextNode(txt), but); else but.parentNode.removeChild(but);} else but.parentNode.removeChild(but);} void 0;

Next, if you are not displaying the Bookmarks Toolbar, you can display it using either:

  • right-click a blank area of the tab bar > Bookmarks Toolbar
  • tap the Alt key > View menu > Toolbars > Bookmarks Toolbar

Right-click on the Bookmarks Toolbar and choose New Bookmark.

Paste the code into the Location box (the second box).

Then type a useful name in the Name box (e.g., Btn2Txt) and click Add.

Now, when you want to hack the buttons in the page, click the bookmark to run the script.

more options

Thanks for the replies, Waka_Flocka_Flame and jscher2000.

jscher2000, the script works.

Is it possible to make the script also "select all" page elements and "copy" them after converting the buttons to plain text ?

Well, I am pushing my luck here. :) It would be nicer if I can click the script once and it does 3 commands sequently. I do not know about javascript.

Thanks.

more options

In Firefox, scripts are restricted in how they interact with the clipboard, so I don't think I can add that last step...

To select the entire document body, you can use this (it would go before the void 0 at the end):

var sel=window.getSelection(); sel.selectAllChildren(document.body);

At that point, you could press Ctrl+c or right-click > Copy. Does it work?

more options

Thanks again, jscher2000.

Based on your explanation, I think the first script is already helpful enough for me now. Select All and Copy are easy for me to do manually.

I thought someone had reported this issue to Firefox team but then I found out that this issue was still there in latest version of FF. I remember that two FF add-ins for sending html contents to MS-OneNote face this issue too and one of the developers had seen it. I also have sent feedback to FF team.

Thank you so much for your replies and for the script.

-=-