Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Copy/Paste

  • 11 replies
  • 2 have this problem
  • 87 views
  • Last reply by jscher2000

more options

Why can a stupid failing script on a web-page, or even intentionally so programmed script disable the copy (and sometimes paste) functionality?

How can this be disabled/fixed?

One highlights a text (any text) on some web sites, Edit menu allows Copy, context menu allows Copy, one hits Copy, nothing happens. It's not even a page where someone wanted to "copy protect" some information.

Copy and Paste should work just as advertised since those were invented, how hard can it be to get that right? Even stupid Notepad never fails at it. And no, I don't care what the idiot who programmed a page though would be/should be best for me, I want Copy to be copy, Paste to be paste. This used to work in "original" Firefoxes even when page developers wanted to make it not work.

And yes, while on a given page Copy fails miserably, at the same time in other pages it works.

All Replies (11)

more options

Hi Pók, sites can detect the copy and paste actions in their scripts and modify the results. You can block this, but then pasting will not work on some sites. You can test it out and see how it goes on the sites you use:

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

(2) In the search box in the page, type or paste clipb and pause while the list is filtered

(3) Double-click the dom.event.clipboardevents.enabled preference to switch the value from true to false

Any difference on the problem site (you might need to reload the page)? If not, then flip it back and I think we'll need more information to understand what the site is doing.

Helpful?

more options

Thanks for the suggestion, but I use pages where the clipboard access is actually useful and needed.

In my opinion the proper solution would allow both JS and the Edit -> Copy menus to set the clipboard, but to only allow overwriting clipboard data set by menus (Edit & context) with clipboard data set by JS if user permission is granted. Or at least not let JS know that the UI has just put something on the clipboard, not giving a chance for the former to "react" and clear the value just set.

And another problem is that I'm not even sure the problem is site-related. E.g. after a browser restart the same page behaved OK, could copy and paste text as expected. What might somehow, maybe had an effect on this is that it was waiting for a restart upon an update (I'm running the Developer beta edition). But that still does not explain why on other pages Copy and Paste did work. Also it is not the first time this happens.

Helpful?

more options

Pók said

Thanks for the suggestion, but I use pages where the clipboard access is actually useful and needed.

I'm not sure I understand your comment. This setting does not prevent copy/paste from working in normal form fields and normal edit areas. It prevents sites from using script events to intercept and modify how copy/paste work on their pages. Let me know if you try it.

And another problem is that I'm not even sure the problem is site-related. E.g. after a browser restart the same page behaved OK, could copy and paste text as expected. What might somehow, maybe had an effect on this is that it was waiting for a restart upon an update (I'm running the Developer beta edition). But that still does not explain why on other pages Copy and Paste did work. Also it is not the first time this happens.

Is there a page where you reliably cannot copy/paste (that doesn't require an account to use)?

Note: there's a link moderation feature on the forum, so if you share a URL without breaking it to make it non-clickable, your post usually will be delayed in appearing.

Helpful?

more options

Do the alternatives work in case the script only blocks the Ctrl key ?

  • Copy: Ctrl+C or Ctrl+Insert (Mac: Command+C)
  • Paste: Ctrl+V or Shift+Insert (Mac: Command+V)
  • Cut: Ctrl+X or Shift+Delete (Mac: Command+X)

Helpful?

more options

jscher2000 said

Pók said

Thanks for the suggestion, but I use pages where the clipboard access is actually useful and needed.

I'm not sure I understand your comment. This setting does not prevent copy/paste from working in normal form fields and normal edit areas. It prevents sites from using script events to intercept and modify how copy/paste work on their pages. Let me know if you try it.

Yes, that's what I mean: I use sites that set the clipboard using scripts. That is why I don't want to disable the functionality.

And another problem is that I'm not even sure the problem is site-related. E.g. after a browser restart the same page behaved OK, could copy and paste text as expected. What might somehow, maybe had an effect on this is that it was waiting for a restart upon an update (I'm running the Developer beta edition). But that still does not explain why on other pages Copy and Paste did work. Also it is not the first time this happens.

Is there a page where you reliably cannot copy/paste (that doesn't require an account to use)?

No, I notice this problem totally random. As mentioned earlier, after a restart the Copy and Paste menus (and shortcut keys) started working again on the very same page.

Note: there's a link moderation feature on the forum, so if you share a URL without breaking it to make it non-clickable, your post usually will be delayed in appearing.

Helpful?

more options

double-post

Modified by Pók

Helpful?

more options

cor-el said

Do the alternatives work in case the script only blocks the Ctrl key ?
  • Copy: Ctrl+C or Ctrl+Insert (Mac: Command+C)
  • Paste: Ctrl+V or Shift+Insert (Mac: Command+V)
  • Cut: Ctrl+X or Shift+Delete (Mac: Command+X)

No, nothing works (menu items, or context menu item or shortcut key). But I can see the page is acting up again: https://nowlearning.service-now.com/lxp?id=overview&sys_id=4469184fdbb024503c55818a13961923&type=course The most I can do when viewing that page is to copy the URL from the address bar. All other pages I have opened at the same time, work as expected.

Restarted with all add-ons disabled in safe mode, still no Edit -> Copy or context menu -> Copy or Ctrl+C or Ctrl+Ins.

Modified by Pók

Helpful?

more options

double-post

Modified by Pók

Helpful?

more options

Yes, I can only copy from the service-now page with dom.event.clipboardevents.enabled set to false. Annoying. They're using features of the Angular framework (ngCopy) to block copying.

Since I don't know how to counterprogram that, I can suggest a slightly inconvenient workaround, which is to select then text and then click a bookmark which executes a script. The script grabs the selected text and pops it into a new tab. The script does not retain the HTML, so it is similar to pasting as plain text. If you want to give it a try:

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

Helpful?

more options

That's a nice trick, thanks. Do you know, now that the Help -> Submit Feedback... page functionality has been disabled, where can one submit a bug report?

Helpful?

more options

There are two options for bug reports:

(A) Site not working correcting in Firefox vs. other browsers:

https://webcompat.com/

(B) Firefox feature broken or needs improvement:

https://bugzilla.mozilla.org/

Helpful?

Ask a question

You must log in to your account to reply to posts. Please start a new question, if you do not have an account yet.