News for hackers. Stuff that matters.
Re:Chrome allows websites to write to the clipboard without ... by zebracanevra on Friday August 26, 2022 @10:10PM (#32614923)
From the chrome bug[0] it seems like this was changed to work without a gesture because the new tab page needs to copy text for a Google Doodle...

So instead of changing their new tab page to require a gesture like all other sites... they decided to allow any website to copy text into the clipboard. Nice.

I think copying into the clipboard needs an overhaul—even with a gesture. Don't you hate when news sites add a "- from XYZ" to your clipboard? That shouldn't be possible. I'm not sure how you'd fix this, but it should be fixed.

[0] crbug.com/1334203

Re:Chrome allows websites to write to the clipboard without ... by kitsunesoba on Friday August 26, 2022 @10:35PM (#32615063)
This is why a web and ad giant shouldn’t be in charge of the world’s most popular browser as well as the world’s most popular web engine. Huge conflict of interest.

Chrome should be spun off into a non-profit that is barred from Google/Alphabet influence.

Re:Chrome allows websites to write to the clipboard without ... by lolinder on Saturday August 27, 2022 @12:47AM (#32615808)
It's worth pointing out that the commit that did this was made by a Microsoft employee who has been working on the clipboard API, not a Google employee.

At a glance and without very much context, it looks to me like this engineer was working on implementing Web Custom formats for the clipboard API [0], but broke the Google doodle sharing while doing so. It appears they were trying to restore old behavior as a temporary measure, but ended up breaking the checks altogether.

Their commit's comment[1] claims that the added variable should only be true if reading/writing a web custom format, but that obviously isn't the case (anymore?).

EDIT: Here is their original commit, which broke the doodle sharing: [2]. It extends the interaction requirement to custom formats, which wasn't true before. Their followup was meant to just undo that part of this commit, but appears to have done much more.

[0] https://chromestatus.com/feature/5649558757441536

[1] https://chromium.googlesource.com/chromium/src/+/4d7b74b051a...

[2] https://chromium.googlesource.com/chromium/src/+/a3b96a459cf...

Re:Chrome allows websites to write to the clipboard without ... by Jenk on Saturday August 27, 2022 @05:40AM (#32617348)
that feels like a rather fragile process for something that is underpinning the internet to permit such mistakes occur so easily.
Re:Chrome allows websites to write to the clipboard without ... by lolinder on Saturday August 27, 2022 @10:54AM (#32619693)
Yes. For one thing, it looks like there was an automated test that warned the doodle was broken, but no such test for clipboard security features.
Re:Chrome allows websites to write to the clipboard without ... by bdougherty on Sunday August 28, 2022 @07:51PM (#32633347)
And underpinning an increasing amount of desktop software now as well.
Re:Chrome allows websites to write to the clipboard without ... by ohgodplsno on Saturday August 27, 2022 @10:30AM (#32619407)
Cool cool cool, we're breaking browsers because Google has complained that their daily doodle can't be copied. Not worrying at all.
Re:Chrome allows websites to write to the clipboard without ... by letssecure on Sunday August 28, 2022 @12:58PM (#32629908)
All changes are approved by chromium devs.
Re:Chrome allows websites to write to the clipboard without ... by de6u99er on Saturday August 27, 2022 @03:19AM (#32616637)
This should be the top comment!
Re:Chrome allows websites to write to the clipboard without ... by stingraycharles on Saturday August 27, 2022 @12:34AM (#32615726)
Mozilla did some pretty nefarious things with Firefox as well though, for some marketing campaigns.

Not saying it’s worse, but it may not necessarily be due to Google also being an ad giant, but just corporations being corporations and having the wrong priorities.

Re:Chrome allows websites to write to the clipboard without ... by dcdc123 on Saturday August 27, 2022 @07:49AM (#32617963)
I’ve been thinking about switching back to Firefox. Care to share an example?
Re:Chrome allows websites to write to the clipboard without ... by christophilus on Saturday August 27, 2022 @08:31AM (#32618245)
Probably the Mr Robot thing. I mostly use Firefox (and recommend it), but they do appear to be run by MBAs or marketers— not sure which.
Re:Chrome allows websites to write to the clipboard without ... by xref on Sunday August 28, 2022 @01:43PM (#32630288)
That was such a strange choice by Mozilla, I mean the plug-in was specifically for people who play the Mr Robot game. Even after Mozilla force-pushed it to their entire user base players still had to manually enable it to play. If the whole damn thing required manual intervention anyway why didn’t they just put it in the addon store to start with?!
Re:Chrome allows websites to write to the clipboard without ... by greenhatman on Saturday August 27, 2022 @08:40PM (#32624651)
It wasn't always like that. I think it changed 2 or 3 years ago.
Re:Chrome allows websites to write to the clipboard without ... by ipaddr on Saturday August 27, 2022 @09:32AM (#32618770)
Love the Mr Robot addon.
Re:Chrome allows websites to write to the clipboard without ... by snapplebobapple on Saturday August 27, 2022 @11:01AM (#32619776)
consider going librewolf instead, if your concern is security. I personally use librewolf for most things and brave for the few things that don't work well on firefox in linux (i.e. playing video from my nvr, my realtor website's 3d floor plan walkout, etc). Floccus and bitwarden keep bookmarks and passwords synced between the two so I barely notice which one I am using.
Re:Chrome allows websites to write to the clipboard without ... by n0n0n4t0r on Saturday August 27, 2022 @10:18AM (#32619302)
It was a reality named Firefox.

But then a concurrent solution happened and almost everyone moved to chrome.

The history is sad but true: it's the general indifference to those conflict of interest that led us here...

Re:Chrome allows websites to write to the clipboard without ... by BbzzbB on Saturday August 27, 2022 @12:38AM (#32615751)
World's most popular mobile OS too. Used to push said browser, ripped of extensibility (I guess they couldn't blacklist ad blockers specifically).
Re:Chrome allows websites to write to the clipboard without ... by swyx on Saturday August 27, 2022 @12:36AM (#32615741)
Google has sunk about $100m into developing Chrome. People need to expect to own things after making big investments. That's how any of this works.

dictate random policies like that and you will watch American capitalism die.

Re:Chrome allows websites to write to the clipboard without ... by josefx on Saturday August 27, 2022 @03:34AM (#32616712)
If that was how the world worked then Blizzard would have lost the rights for Diablo to a hand full of wales.

Dumping a ton of money down the toilet doesn't mean you own the toilet.

Re:Chrome allows websites to write to the clipboard without ... by cma on Saturday August 27, 2022 @01:36AM (#32616067)
Most of the development work they gave away free under a public domain like license.
Re:Chrome allows websites to write to the clipboard without ... by catach on Saturday August 27, 2022 @03:03AM (#32616554)
If "capitalism" can't survive reasonable consumer protection then perhaps it deserves to die, sure.
[dead]
Re:Chrome allows websites to write to the clipboard without ... by dmitriid on Saturday August 27, 2022 @05:48AM (#32617383)
As if those countries had anything reasonable.

Why don't you look to Europe instead?

Re:Chrome allows websites to write to the clipboard without ... by teh64 on Saturday August 27, 2022 @06:53AM (#32617685)
Russia is literally capitalist though????
Re:Chrome allows websites to write to the clipboard without ... by immibis on Saturday August 27, 2022 @09:41AM (#32618884)
This is true. Russia is in fact a good case study of late-stage capitalism. You see, in American capitalism, everyone started equally and then had to build up to their monopoly positions today. In Russia, some people just started out with monopoly positions, due to corruption. So if we want to see what happens due to monopoly positions, we can just look there.
Re:Chrome allows websites to write to the clipboard without ... by ajsnigrutin on Saturday August 27, 2022 @10:16AM (#32619279)
Americans all started equally? You sure, that the early comers, to america, who got huge amounts of land and resources started equally to irish and itallian immigrants?

And even the modern monopolies... Gates and his mom getting him a deal with IBM is a bit different than someone else without a well connected mom.

And looking at tax rates companies like facebook pay, I think corruption is very well alive in USA too.

Re:Chrome allows websites to write to the clipboard without ... by immibis on Saturday August 27, 2022 @10:52AM (#32619670)
Started equally, quickly became unequal, but nowhere near as quickly as Russia, which started at maximum inequality.
Re:Chrome allows websites to write to the clipboard without ... by bjelkeman-again on Saturday August 27, 2022 @05:49AM (#32617387)
There is a middle ground.

“As a policy regime, it is described by academics as advocating economic and social interventions to promote social justice within the framework of a liberal-democratic polity and a capitalist-oriented mixed economy.”

Some of the world’s most successful countries are run that way.

It is called social democracy.

Re:Chrome allows websites to write to the clipboard without ... by Ensorceled on Saturday August 27, 2022 @06:47AM (#32617654)
I'd like to think there are a wider group of options than a binary choice between "American Late-Stage Capitalism" and "Venezuela"
Re:Chrome allows websites to write to the clipboard without ... by vilaca on Saturday August 27, 2022 @06:06AM (#32617478)
I'm sorry to have to break it to you but Venezuela and Iran are capitalist countries.
Re:Chrome allows websites to write to the clipboard without ... by vixen99 on Saturday August 27, 2022 @06:21AM (#32617536)
Perhaps when make a similar comment in future you could expand a bit and sketch out a possible alternative to that of people being free to to trade things of value with other people under the aegis of a dynamic regulatory system? I guess you mean a specific meaning of 'capitalism' but the nature of that is not clear at all.
Re:Chrome allows websites to write to the clipboard without ... by catach on Saturday August 27, 2022 @07:25AM (#32617844)
Consider:

Option 1: the definition of "capitalism" requires that zero regulation be applied. In that case, abandon "capitalism" and replace it with whatever you'd call the same model but with regulation.

Option 2: a significant amount of regulation actually is enough alone to fatally destabilize capitalism. I do not believe this to be the case, but if it were, then it should very likely be abandoned, but it's difficult to know how other options might behave in this hypothetical universe.

Re:Chrome allows websites to write to the clipboard without ... by feet on Saturday August 27, 2022 @08:21AM (#32618162)
I would argue that capitalism is exactly what the American system is. These terms are descriptive rather than prescriptive.
Re:Chrome allows websites to write to the clipboard without ... by catach on Sunday August 28, 2022 @11:06PM (#32634384)
That's certainly a model one could use, but it strikes me as not particularly useful.
Re:Chrome allows websites to write to the clipboard without ... by feet on Monday August 29, 2022 @06:49AM (#32636616)
Claiming lofty ideology is not useful because those policies never exist in real life
Re:Chrome allows websites to write to the clipboard without ... by catach on Monday August 29, 2022 @01:31PM (#32640981)
Increased precision in base concepts makes it easier to measure and reason about the real-world drift from those bases.
Re:Chrome allows websites to write to the clipboard without ... by feet on Monday August 29, 2022 @04:45PM (#32643335)
That's assuming that those bases are even the goal for the people implementing the policies, which I am not convinced is the case in the US.

If that is not the assumption then we can just make arbitrary claims about anything and calculate "drift"

Re:Chrome allows websites to write to the clipboard without ... by catach on Tuesday August 30, 2022 @03:42AM (#32647694)
I'm looking at this from an economics study view, not a public policy view.

Definitions have an inherently arbitrary component, sure. But stable, precise definitions are far easier to reason with than a shifting definition like "whatever the US is doing right now".

Re:Chrome allows websites to write to the clipboard without ... by feet on Tuesday August 30, 2022 @04:00AM (#32647826)
The study of economics is not exactly known for its rigor, I'm not sure how much value that has
Re:Chrome allows websites to write to the clipboard without ... by catach on Tuesday August 30, 2022 @04:41AM (#32648041)
Gotta start somewhere.
Re:Chrome allows websites to write to the clipboard without ... by feet on Tuesday August 30, 2022 @06:20AM (#32648632)
Do you think capitalism can exist without policy and regulation?
Re:Chrome allows websites to write to the clipboard without ... by gilrain on Saturday August 27, 2022 @09:29AM (#32618725)
People being free to trade things of value is not capitalism. Many other economic systems allow for this.
Re:Chrome allows websites to write to the clipboard without ... by xg15 on Saturday August 27, 2022 @06:30AM (#32617582)
Ok, so wanting to stop Google from messing with my system is communism?
Re:Chrome allows websites to write to the clipboard without ... by dontlaugh on Saturday August 27, 2022 @07:59AM (#32618030)
That’s not entirely inaccurate.

Capitalism requires that the capitalists (who own for a living) are in control of the state, so it has little incentive to stop Google from messing with your system.

The only certain way to stop them is for workers (who work for a living, the majority of us) gain control of state power through a socialist revolution. Those historically are led by communists or similar.

So if you want control over your computer and ultimately life, join us in conspiring to overthrow capitalism.

Re:Chrome allows websites to write to the clipboard without ... by christophilus on Saturday August 27, 2022 @08:34AM (#32618271)
The opposite throughout history seems to be the State becomes both the government, and those who “own for a living”. You go from a mixture of corrupt powers to one corrupt, almost absolute power.

I choose neither. Is there another alternative?

Re:Chrome allows websites to write to the clipboard without ... by dontlaugh on Saturday August 27, 2022 @08:39AM (#32618311)
That can happen, but it’s debatable how common it has been historically.

But it’s worth keeping in mind that the capitalists also control the media, school curriculums, academia (including economics and history), etc. It’s not hard for them to portray all socialist countries as far worse than they are, in order to discourage workers from rising up. And of course it is in the capitalists interest to do so.

Re:Chrome allows websites to write to the clipboard without ... by ajsnigrutin on Saturday August 27, 2022 @10:19AM (#32619310)
As someone who has lived in this kind of a system in a country that doesn't exist anymore, I'd be (and am) a lot happier in a capitalist system, where workers can choose anytime to create their own budiness without the government owning it.

I'd be even happier if governments treated small businesses the same as they treat large (mostly by making tax avoidance impossible, and making the large pay the same taxes as the small ones to), but that's practically impossible with the corruption in our governments.

Re:Chrome allows websites to write to the clipboard without ... by dontlaugh on Saturday August 27, 2022 @11:26AM (#32620037)
Workers need capital to create a business. They can’t gain capital while the majority of the surplus they create through labour is taken by capitalists.

You’re happier in a richer country, as are many of us Eastern Europeans that have been forced to emigrate. We could’ve been even happier in our own countries while having collective control over the means of production, but the (foreign) capitalists made sure that wasn’t possible through propaganda, coups, sanctions and invasions.

Re:Chrome allows websites to write to the clipboard without ... by ajsnigrutin on Saturday August 27, 2022 @12:51PM (#32620853)
Many, many businesses need very little capital to start, less than a price of a car, that most of the people complaining about that, are currently driving.

I haven't moved, I still live in the same city, the country is the one that doesn't exist anymore.

Re:Chrome allows websites to write to the clipboard without ... by feet on Saturday August 27, 2022 @08:34AM (#32618267)
The way I see it is that forms of socialism and communism are true democracies in that when everyone is part of the state we should all have equal say, an equal vote in deciding policy
Re:Chrome allows websites to write to the clipboard without ... by croes on Saturday August 27, 2022 @07:17AM (#32617808)
Depends on who you ask.
Re:Chrome allows websites to write to the clipboard without ... by hardware2win on Saturday August 27, 2022 @05:18AM (#32617237)
Da fuck?

Only 100m?

Re:Chrome allows websites to write to the clipboard without ... by pleb_nz on Saturday August 27, 2022 @06:05AM (#32617468)
I would have thought 10x 100m minimum
Re:Chrome allows websites to write to the clipboard without ... by StingyJelly on Saturday August 27, 2022 @09:06AM (#32618513)
Google has achieved high economies of scale in many areas but mainly in skirting taxation and government regulation. That's corrupt cronyism, not capitalim. The positive quality of capitalism is it's efficiency, good luck finding that inside bureaucratic google.
Re:Chrome allows websites to write to the clipboard without ... by brnzh on Saturday August 27, 2022 @07:37PM (#32624334)
It's literally just capitalism lmao
Re:Chrome allows websites to write to the clipboard without ... by StingyJelly on Sunday August 28, 2022 @05:32AM (#32626990)
Capitalism requires competition and there is little competition in anything google does. That's in large part due to how heavily "subsidized" they became thanks to governments "overlooking" blatant tax avoidance.
Re:Chrome allows websites to write to the clipboard without ... by paledot on Saturday August 27, 2022 @10:47AM (#32619596)
Ooh, that's all I have to do to watch American capitalism die?
Re:Chrome allows websites to write to the clipboard without ... by immibis on Saturday August 27, 2022 @09:39AM (#32618853)
Putin has invested much more into owning Russia. According to your logic, we must allow Putin to own Russia.
Re:Chrome allows websites to write to the clipboard without ... by Kamq on Saturday August 27, 2022 @09:54AM (#32619048)
I mean, for the most part we did.

It was when he wanted to own Ukraine that it rose to the level of significant intervention by the outside world.

Re:Chrome allows websites to write to the clipboard without ... by immibis on Saturday August 27, 2022 @10:53AM (#32619679)
Putin has invested significant resources into owning Ukraine, too, so if people have a right to own whatever they invest significant resources into, then Putin has a right to own Ukraine.
Re:Chrome allows websites to write to the clipboard without ... by Kamq on Saturday August 27, 2022 @05:42PM (#32623506)
Yes, but (continuing the argument) the rest of the world has also invested significant resources into Ukraine to counter his ownership claim (in a way that never really happened while he was solidifying his hold on Russia).
Re:Chrome allows websites to write to the clipboard without ... by ClassyJacket on Saturday August 27, 2022 @06:36AM (#32617600)
>you will watch American capitalism die.

That's one of my explicit goals, so good.

Re:Chrome allows websites to write to the clipboard without ... by ajsnigrutin on Saturday August 27, 2022 @10:20AM (#32619320)
So, which system do you recommend then?

I'm from a former socialist country (both former socialist, and former country, since neither exist anymore).

Re:Chrome allows websites to write to the clipboard without ... by zetafunction on Saturday August 27, 2022 @02:48AM (#32616452)
Disclaimer: I am a Chrome developer, who formerly worked on the clipboard.

For a long time, Chrome did not allow pages on the open web to use document.execCommand('copy') or document.execCommand('cut'), and there was a fairly steady stream of requests from web developers to enable this. Eventually, Chrome did expose this gated behind a user gesture: https://chromestatus.com/feature/5223997243392000

> So instead of changing their new tab page to require a gesture like all other sites... they decided to allow any website to copy text into the clipboard. Nice.

Ownership of the clipboard features has moved around a bit, and sometimes historical context around things like the user gesture requirement are lost. Here, the NTP doesn't actually need this to work without a user gesture. The correct fix here is to fix the NTP tests to correctly simulate a user gesture, not to allow writing to the clipboard without a user gesture.

> I think copying into the clipboard needs an overhaul—even with a gesture. Don't you hate when news sites add a "- from XYZ" to your clipboard? That shouldn't be possible. I'm not sure how you'd fix this, but it should be fixed.

This is a difficult problem to fix. There are absolutely websites that abuse this. But there are also pages that do use the legacy clipboard API events in non-abusive ways (e.g. rich text editors), and blocking this outright would break legitimate uses as well.

Maybe something like a "copy as plain text" option would make sense...

Re:Chrome allows websites to write to the clipboard without ... by dotancohen on Saturday August 27, 2022 @05:44AM (#32617365)

  > Maybe something like a "copy as plain text" option would make sense
That's ask I _ever_ want. I never want to copy rich text. I even have a background script that removes formatting from the clipboard every second, to make copying less frustrating.

Hide it in some hidden flag or something, but please, make plain text copying an option!

Re:Chrome allows websites to write to the clipboard without ... by jhugo on Saturday August 27, 2022 @10:09AM (#32619198)
Right? I think, in 25+ years of computing, I have never once wanted to paste rich text. Ever. I just want to paste the text! Yet every time, I have to either fumble for the "paste and match style" key combo, or fix things afterwards.
Re:Chrome allows websites to write to the clipboard without ... by yjftsjthsd-h on Saturday August 27, 2022 @11:29AM (#32620070)
FWIW, I actually have wanted that, usually when I'm copying a chunk of text and I want to keep inline hyperlinks intact. I'm not sure I want that more often than I want a plain text option that strips out all the formatting, but it does come up.
Re:Chrome allows websites to write to the clipboard without ... by Pxtl on Monday August 29, 2022 @03:30PM (#32642456)
The trick is that 99% of the time I want Markdown. That is, I want hyperlinks, bullets, headers, strong, etc. to stay hyperlinks, bullets, headers, etc.

But all the other styling? The fonts, the colors, stuff like that that isn't in markdown? Nobody wants that.

Re:Chrome allows websites to write to the clipboard without ... by rav on Saturday August 27, 2022 @08:37AM (#32618296)
Don't most apps allow you to paste plain text with Ctrl+Shift+V nowadays? That's what I almost always use, unless I have some use for the copied rich text.
Re:Chrome allows websites to write to the clipboard without ... by kevincox on Saturday August 27, 2022 @09:58AM (#32619090)
Annoyingly the GitHub comment box doesn't. Incredibly frustrating to copy someones name from the GitHub webpage and paste it and it pastes as a markdown link which doesn't trigger a mention.
Re:Chrome allows websites to write to the clipboard without ... by lupire on Saturday August 27, 2022 @09:06PM (#32624772)
Aside from GitHub doing something dumb here, Paste without formatting belongs as a browser or OS feature, not per-website code.
Re:Chrome allows websites to write to the clipboard without ... by hosteur on Saturday August 27, 2022 @07:55AM (#32617996)
Great idea with such a script. Do you want to share it?
Re:Chrome allows websites to write to the clipboard without ... by dotancohen on Sunday August 28, 2022 @05:02AM (#32626870)
Sure, it depends on `xclip`, which you might need to install, and `perl` which you probably already have. I only run it while I'm actually copying and pasting as I don't like leaving loops running, that said, with the 1 second sleep it's really not so bad.

  #!/bin/bash
  while true ; do xclip -sel primary -o | perl -pe 'chomp if eof' | xclip -sel primary ; sleep 1 ; done
Note that this affects only the primary selection, e.g. the copy-on-highlight and paste-on-middle-click clipboard. I hardly ever use the rodent, but when I do, this is what I use it for. You could easily adapt the script to the Ctrl-C Ctrl-V clipboard.
Re:Chrome allows websites to write to the clipboard without ... by lupire on Saturday August 27, 2022 @09:05PM (#32624767)
> Hide it in some hidden flag

Google is deeply philosophically opposed to doing that. Power users are a distraction from the billions of normal users.

Re:Chrome allows websites to write to the clipboard without ... by dotancohen on Sunday August 28, 2022 @09:59AM (#32628427)
Then make it a regular option. My point was that _if_ it's not deemed important enough to expose a UI option for, at least let make it possible some other way.
Re:Chrome allows websites to write to the clipboard without ... by majou on Saturday August 27, 2022 @07:52AM (#32617983)
macOS has "paste as plaintext" instead.
Re:Chrome allows websites to write to the clipboard without ... by macintux on Saturday August 27, 2022 @08:30AM (#32618232)
I’ve remapped ⌘V on my work laptop to paste as plain text which works great everywhere except Outlook, which disables that in email metadata (recipients, subject).

So bloody annoying, thanks Microsoft for continuing to make my life harder than it needs to be.

Re:Chrome allows websites to write to the clipboard without ... by lupire on Saturday August 27, 2022 @09:08PM (#32624783)
Better than Gmail which automatically parses text on paste, and, as the cherry on top, even when it recognizes that and alerts on a failed parse (making a red chip), refuses to let you edit the text to fix it.
Re:Chrome allows websites to write to the clipboard without ... by lupire on Saturday August 27, 2022 @09:03PM (#32624756)
All we need is "copy without running JavaScript". Just look at what is actually rendered, and copy that. And it should be the default.
Re:Chrome allows websites to write to the clipboard without ... by userbinator on Saturday August 27, 2022 @03:24AM (#32616661)
Why do you call it a "user gesture" and not "consent" as it should absolutely be? Is it to reinforce the notion that users' actions are only to be taken as mere suggestions and ignored if they are contrary to your goals?
Re:Chrome allows websites to write to the clipboard without ... by samwillis on Saturday August 27, 2022 @04:13AM (#32616926)
"user gesture" and "consent" are two completely different things.

Currently (until this bug) it’s supposed to trace back the call stack to the event that triggered it, and only allow it if the triggering event is something like a click. That’s what’s meant by “user gesture”, the opposite of code triggering it independently of the user.

“Consent” would be a positive acceptance in a browser controlled message box asking for permission to use the clipboard.

Most people agree that for copying to the clipboard the first is all that’s needed (there isn’t really a security concern here), for pasting from the clipboard the later is always required.

Re:Chrome allows websites to write to the clipboard without ... by userbinator on Saturday August 27, 2022 @06:01AM (#32617441)
there isn’t really a security concern here

See the other discussion here: https://news.ycombinator.com/item?id=32614839

Re:Chrome allows websites to write to the clipboard without ... by samwillis on Saturday August 27, 2022 @06:47AM (#32617651)
Ok, so there is a related vector here, but it requires the site your are on to be compromised.

I would argue the actual vector is in the terminal, it should really validate the clipboard content.

Re:Chrome allows websites to write to the clipboard without ... by PoignardAzur on Saturday August 27, 2022 @04:04AM (#32616874)
> Is it to reinforce the notion that users' actions are only to be taken as mere suggestions and ignored if they are contrary to your goals?

Wow, rude.

One possible answer to your question: there is no way for a browser to detect "consent", which is a subtle and nuanced concept, but user gestures have a hard and fast definition, so that's the proxy they use.

Re:Chrome allows websites to write to the clipboard without ... by ndriscoll on Saturday August 27, 2022 @10:18AM (#32619300)
When a site wants access to my camera or microphone, the browser detects my consent by asking me. I don't see why listening to clipboard events shouldn't be treated in the same way. Likewise with mouse and keyboard tracking events.

The number of sites that reasonably need to know when I copy/paste or need to override what happens when I do that is approximately zero. There's no reason to allow it by default for all sites.

Re:Chrome allows websites to write to the clipboard without ... by matheusmoreira on Friday August 26, 2022 @10:29PM (#32615026)
> Don't you hate when news sites add a "- from XYZ" to your clipboard?

And then there's the "clever" sites that replace the text I copied with a message like "haha you thought you could copy this? think again sucker".

Re:Chrome allows websites to write to the clipboard without ... by zebracanevra on Friday August 26, 2022 @10:32PM (#32615043)
I feel like if you've selected some text, then pressing copy should always copy that text and nothing else.

But then: what's to stop websites from detecting you've selected text, unselecting it, and copying the bad text in, and then reselecting it...

There are so many loopholes I can imagine to get around these restrictions :(

Re:Chrome allows websites to write to the clipboard without ... by HWR_14 on Saturday August 27, 2022 @01:29AM (#32616030)
> what's to stop websites from detecting you've selected text, unselecting it, and copying the bad text in, and then reselecting it

Disabling JavaScript.

Re:Chrome allows websites to write to the clipboard without ... by devmunchies on Saturday August 27, 2022 @04:31AM (#32617022)
it'd be trivial to trick users to copy the wrong text with only CSS.
Re:Chrome allows websites to write to the clipboard without ... by HWR_14 on Sunday August 28, 2022 @02:59PM (#32630977)
Wait, how?
Re:Chrome allows websites to write to the clipboard without ... by devmunchies on Sunday August 28, 2022 @05:59PM (#32632497)
Make a layer that isn’t visible with “opacity: 0” that sits in front of the visible text. A user copies the invisible text instead.

Or conversely, make the visible text “pointer-events: none” and it sits in front of the dangerous text.

Re:Chrome allows websites to write to the clipboard without ... by HWR_14 on Monday August 29, 2022 @12:16AM (#32634750)
Both of those make sense.
Re:Chrome allows websites to write to the clipboard without ... by Latty on Saturday August 27, 2022 @12:16AM (#32615619)
If you just want to add text in, it is even easier, no JS required. just CSS: insert an element into your text that is positioned off-screen. When the user selects and copies, they'll get that text too.
Re:Chrome allows websites to write to the clipboard without ... by justahuman74 on Friday August 26, 2022 @10:43PM (#32615113)
Why are websites allowed to know that you've selected plain text? (genuinely clueless on web stuff)
Re:Chrome allows websites to write to the clipboard without ... by zebracanevra on Friday August 26, 2022 @10:50PM (#32615160)
I think there are a bunch of decent uses for that, like rich text editors (eg select text, hit ctrl-b, and the text is bolded).

There are also some sites that popup a small box above your selection with a share box. Straight to hell with those. Compulsive selectors go mad on those sites. That's you, medium.com.

Re:Chrome allows websites to write to the clipboard without ... by denton-scratch on Saturday August 27, 2022 @09:38AM (#32618840)
But why does a rich text editor need to talk to a website?
Re:Chrome allows websites to write to the clipboard without ... by LocalH on Saturday August 27, 2022 @09:51AM (#32619010)
What if the rich text editor and the website are the same thing? What if the rich text editor is part of a larger tool that is the website?
Re:Chrome allows websites to write to the clipboard without ... by denton-scratch on Saturday August 27, 2022 @10:16AM (#32619268)
Well, I'm not sure what you're waving at. If the website is nothing more than a RTE, then it's better (and safer) to do it in the browser. If the RTE is just part of the website, then that's a part that's better done in the browser.

Perhaps you want a RTE that doesn't depend on JS. I think that's a reasonable thing to want; but if you normally browse with JS switched off, then running into a working RTE is at least going to violate the Principle of Least Surprise.

Re:Chrome allows websites to write to the clipboard without ... by entropie on Friday August 26, 2022 @11:00PM (#32615214)
Why are websites allowed to know that I hover an element?

Javascript knows about clicks, doubleclicks, hovers... like almost every interaction the user does. There are use cases but also potential to be exploited somehow.

Re:Chrome allows websites to write to the clipboard without ... by paulryanrogers on Friday August 26, 2022 @11:21PM (#32615312)
Because websites are apps now. The browser is your operating system.
Re:Chrome allows websites to write to the clipboard without ... by cypress66 on Friday August 26, 2022 @11:43PM (#32615420)
Click events, hover, etc have always existed (since js exists I'm pretty sure).
Re:Chrome allows websites to write to the clipboard without ... by paulryanrogers on Saturday August 27, 2022 @11:10AM (#32619871)
Regardless of intent, today websites are often built as 'apps', making browsers more and more like your OS. JS is how that's usually implemented.
Re:Chrome allows websites to write to the clipboard without ... by shultays on Saturday August 27, 2022 @06:13AM (#32617506)
In forums you can select parts of someone's post and quote that part in your reply
Re:Chrome allows websites to write to the clipboard without ... by oarabbus_ on Friday August 26, 2022 @11:46PM (#32615430)
Humor me as someone without much web development experience - but what's to stop websites from displaying unclosable ads/popups? As in the "x" does nothing, or maybe doesn't appear at all?
Re:Chrome allows websites to write to the clipboard without ... by dreadlordbone on Saturday August 27, 2022 @12:13AM (#32615589)
It happens, but then people tend to not visit the site.
Re:Chrome allows websites to write to the clipboard without ... by dotancohen on Saturday August 27, 2022 @05:50AM (#32617394)
Both Pinterest and Quora have unclosable popups, as do many news websites.
Re:Chrome allows websites to write to the clipboard without ... by manfre on Saturday August 27, 2022 @06:05AM (#32617470)
There is a reason many articles and extensions exist to avoid those sites in search results.
Re:Chrome allows websites to write to the clipboard without ... by matheusmoreira on Saturday August 27, 2022 @09:19AM (#32618632)
> what's to stop websites from displaying unclosable ads/popups?

My uBlock Origin filters stop them with extreme prejudice.

Re:Chrome allows websites to write to the clipboard without ... by rasz on Saturday August 27, 2022 @10:28AM (#32619384)
Enjoy them while you can, less than one year left.
Re:Chrome allows websites to write to the clipboard without ... by rasz on Saturday August 27, 2022 @07:06AM (#32617755)
userscript injecting this everywhere:

    window.addEventListener('copy', function copyintercept(e) {
      console.log(copyintercept.caller, 'copy action initiated');
      e.stopImmediatePropagation();
    }, true)
    
    document.addEventListener("contextmenu", bringBackDefault, true);
    
    function bringBackDefault(event) { event.returnValue = true;
                                      (typeof event.stopPropagation === 'function') && event.stopPropagation();
                                      (typeof event.cancelBubble === 'function') && event.cancelBubble();
                                     }
Re:Chrome allows websites to write to the clipboard without ... by hulitu on Saturday August 27, 2022 @01:05AM (#32615901)
A news website must not know that i selected text. A webpage shall display text. Keyboard input shall not be allowed except in text fields.
Re:Chrome allows websites to write to the clipboard without ... by beebeepka on Saturday August 27, 2022 @04:26AM (#32616995)
I guess you must be really pissed off at something because you're not making any sense.

Couple of things

1. How do you focus a text field without a keyboard? Mouse or touch only? No TAB, no up/down keys for scrolling, no escape, etc.

2. You can disable all non text content in a web page. This was always possible

I can go on and on but what's the point?

Re:Chrome allows websites to write to the clipboard without ... by blep-arsh on Sunday August 28, 2022 @08:41AM (#32627964)
Firefox has (had?) a flag to disable clipboard-related JS events but this flag is global and toggling it breaks copying from various rich text editors.
Re:Chrome allows websites to write to the clipboard without ... by jacquesm on Saturday August 27, 2022 @07:17AM (#32617812)
That's pretty benign. Replacing it with "rm -rf /" would be a lot nastier. (And will teach people not to browse with root windows open ;) ).
Re:Chrome allows websites to write to the clipboard without ... by ndriscoll on Friday August 26, 2022 @11:12PM (#32615267)
> Don't you hate when news sites add a "- from XYZ" to your clipboard? That shouldn't be possible.

I opened a bug with chromium when I first encountered that behavior ~10 years ago since it was an obvious security and privacy concern to me. Needless to say, the chromium devs didn't think it's an issue.

You would think browsers would ask permission for sites to do things like modify your clipboard, see when you copy/paste, track your mouse movements and text selections, etc. but google obviously isn't going to care about protecting the user from such things.

Re:Chrome allows websites to write to the clipboard without ... by chalupa-man on Monday August 29, 2022 @08:38PM (#32645358)
You don't need to modify the clipboard to do that, news sites were doing it long before the clipboard API existed. It's usually done with CSS, abusing display properties, positioning, font size, etc to make attributions a non-visible but still copied part of the text.
Re:Chrome allows websites to write to the clipboard without ... by zzo38computer on Friday August 26, 2022 @10:22PM (#32614990)
One thing that should be done is a user setting to configure this capability. If it is disabled then their copying to clipboard does not have any effect (this is not detectable by the web page), except if you push the key combinations (or menu items) to normally do so while the text is selected in which case only that text is copied to the clipboard. This also would affect which text can be selected, too, not only the clipboard. Disabling fonts also can be possible, etc.

(On my computer I usually disable the scripts so that it will not do such a things, but even if scripts are enabled, you might want to configure that feature too.)

Re:Chrome allows websites to write to the clipboard without ... by BeefWellington on Friday August 26, 2022 @11:31PM (#32615365)
Firefox does this via the setting:

    dom.event.clipboardevents.enabled
Re:Chrome allows websites to write to the clipboard without ... by dawnerd on Saturday August 27, 2022 @09:56AM (#32619067)
A long time ago I developed a way to append that text you’re talking about as an in house feature so we didn’t have to use that service whose name is escaping me right now. Probably spent two weeks making it cross browser. It was fairly simple at the end of the day and didn’t require any exploits to the clipboard api, just some really good assumptions to and timing it just right to flip some selection. The hard part was restoring the users original selection without making it obvious. I still hate that I did this.
Re:Chrome allows websites to write to the clipboard without ... by lapcat on Friday August 26, 2022 @11:26PM (#32615341)
> Don't you hate when news sites add a "- from XYZ" to your clipboard? That shouldn't be possible. I'm not sure how you'd fix this, but it should be fixed.

There are browser extensions. For example, my own StopTheMadness on macOS and iOS:

https://underpassapp.com/StopTheMadness/

I'm going to work on this navigator.clipboard issue, because I find it unsettling, and I use Chrome quite a bit.

Re:Chrome allows websites to write to the clipboard without ... by samatman on Saturday August 27, 2022 @12:51PM (#32620852)
Google search could put an end to that practice by having crawlers select and copy some text, and penalizing sites which gunk up the results.

Will they? Hah.