Hacker News new | ask | show | jobs
by 0zymandiass 2309 days ago
about:config -> dom.event.clipboardevents.enabled = false

You can't do it through a user agent, though

2 comments

I'm pretty sure this breaks copying from google docs.
I can highlight and ctrl+c without issue in their Writer clone. Never tried any others.

I've only ever seen that setting fix sites that try to prevent you from copying.

I’ve used clipboard events for legitimate uses - for example I use them in this pseudo Turing sandpit / visual programming system to move, copy and export content: https://steam.dance/ (you can hold shift for a selection box and once selected you can copy, etc).

But I wouldn’t be surprised if stuff like this is the exception rather than the rule. I feel like most news sites and blogs are improved with JavaScript disabled.

You're getting far enough into JS knowledge that I don't have.

Do you actually need clipboard events, or just dom.event.contextmenu.enabled for that?

Put another way, on a website like draw.io, you need to be able to hook into copy to allow lassoing and copying a set of shapes (and have them remain editable when pasted).

The entire ask (stopping the copyright, and allow clipboard integration) be achieved by allowing pages to augment the clipboard data, which can already be done, but not replace it. Pages would still need to be able to hook paste.

Being able to hook paste is a much more reasonable ask. If you have js enabled, they're going to be able to access the content after paste anyway, so it's reasonable to allow notification that a paste has occurred.
Be aware that some websites will completely break when pasting when this is disabled (e.g. Twitter, Facebook, probably more).
Pasting is completely broken on Facebook for me anyway, if I paste at the start of a line it deletes the whole comment box. Originally I thought it was related to this config setting but toggling it made no difference.

So many lost rants ... ;o)