JavaScript modifying cut and paste can sometimes be a good thing in browsers
utcc.utoronto.ca
utcc.utoronto.ca
Also useful on treasurydirect.gov which has a ridiculous password entry field. They make an on-screen "keyboard" with a bunch of JS buttons, you have to click those buttons to enter your password. You can't type into the password field or paste into it.
I use "Happy Right-Click" firefox addon for this. Just click the addon icon located on the address bar and voila.
I assumed it's against keyloggers.
<a href="URL">
<span class="invisible">https://</span>
<span class="ellipsis">example.com/</span>
<span class="invisible">the/rest/of/the/url</span>
</a>
With semi-obvious CSS rulesNot once have I seen this function used in a non-abusive manner. More often then not it's either used to inject advertisements or copyright notices in the content copied to the clipboard.
When you issue a copy command, what should appear on the clipboard is EXACTLY what is selected. I wish browser makers would stop adding useless new features and get down to brass tacks. It's 2023 and sites can still detect incognito mode which defeats the purpose.
Like still, how is cancer a relevant metaphor? What's the cancerous cell that is avoiding typical cell death and reproducing unexpectedly? How is it taking resources from the group of cells that would usually use them?
Most deer hunters are looking to either take home a trophy or meat (or both). The use of a grenade to kill the deer would lead to the destruction of both meat and trophy.
While some hunters are hunting for sport and may enjoy the challenge over the trophy or the meat, these tend select an underpowered weapon (such as a bow and arrow) rather than an overpowered weapon (such as a grenade).
Just make it clear what is going to happen when you click that button/icon.
It baffles me why that was ever made accessible to apps or programs.
I disagree. There are plenty of situations where you would want to copy something that isn't the direct object you're selecting.
Some simple examples:
1. Copying an object that uses a non-human readable format for an underlying data structure. If I'm pasting this into another application, I likely don't want to paste the bytecode or a JSON representation, but rather a text-readable representation or an image representation of that object.
2. Copying latex syntax when selecting mathematical equations rather than copying a SVG.
3. Copying or omitting rich text decorators (i.e. markdown decorators)
4. Copying an email address rather than a human-readable name if selecting a user-pill in an email "to" field.
The API isn't the issue. There are a ton of situations where using it improves the user experience. It's growth-marketing tactics that are the issue.
edit to add an example:
data:text/html,<div>123<b style="font-size:0">456</b>789</div>overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
This same method is also used to trick people into executing nefarious shell commands of which an example can be seen here https://thejh.net/misc/website-terminal-copy-paste
It's installed by default on many operating systems (and easy to get hold of, otherwise)