5 ms·
Nicely done! Here's the underlying source: <p class="codeblock"> <!-- Oh noes, you found it! --> git clone <span style="position: absolu
by raymondh 14y ago
Nicely done! Here's the underlying source:
<p class="codeblock">
<!-- Oh noes, you found it! -->
git clone
<span style="position: absolute; left: -100px; top: -100px">/dev/null; clear; echo -n "Hello ";whoami|tr -d '\n';echo -e '!\nThat was a bad idea. Don'"'"'t copy code from websites you don'"'"'t trust!<br>Here'"'"'s the first line of your /etc/passwd: ';head -n1 /etc/passwd<br>git clone </span>
git://git.kernel.org/pub/scm/utils/kup/kup.git
</p>
- cmsj 14y agoI was expecting it to be done with Javascript, which is, afaik, how the horrible websites that tack a URL and a "this quote came from blah" attribution, work. I hate all of this stuff and it is greatly saddening that browser vendors are not protecting us from it. It's like the pop-up-on-click days of old and it must stop. If I select some text and copy it, I am taking a very explicit action. I am giving the computer a very explicit instruction. There is no room for interpretation. It must not disobey me!
- TheJH_ 14y agoYes, I got the idea from all the sites that do it using Javascript, but I wanted to post the example to ##security, and half of the people there probably has the browser set to "block JS by default" :D
- fnordfnordfnord 14y agoIt'd be funnier if you invoke 'sl' in their shell.
- TheJH_ 14y agoDefinitely, I didn't even know that command :D - but I had to `apt-get install sl` on my machine first. Maybe just do a telnet to a nonstandard port on my server and then send special characters to do the animation? That could work...
- fnordfnordfnord 14y agoYeah, I didn't consider the fact that not everyone has sl on their machine.
- qu4z-2 14y agoIt is a sad world we live in where some people don't have sl installed.
- dllthomas 14y agosl is horrible - I don't need to waste however many seconds just because I mistyped something.
- cmsj 14y agoI always install sl because it helps me. If I'm frustrated from typing too quickly/angrily to even get "ls" right, the little train breaks me out of my fugue state and I have to laugh and shout "choo choo!" in the office :D
- deleted 14y ago[deleted]
- eli 14y agoThat's a pretty narrow view. Sometimes I want a site to capture selections or right-click (think: WYSIWYG editor widget). Your beef is with the site owners who put that obnoxious stuff on their site, not with the browser that displays it. There is no limit to the number of ways a site owner can do dumb and annoying things to their readers.
- pekk 14y agoSince site owners are often not trustworthy on petty issues like this, it would be nice if browsers would make an effort to protect from the more obvious forms of malice rather than telling the user that it's their fault if anything happens
- gbog 14y ago> capture selections or right-click (think: WYSIWYG editor widget) Why, no, not the same. I think it is ok for a webapp to be aware that I selected some text, and which text, so a further click on "boldface" would have a context. But it is not ok for a webapp to interfere with the text selection itself. For instance, well-intentionned chrome always add "http:// http:// when I select the url. It gets in my way very often and it is not what I intended: I did select google.com with my mouse very carefully, I do not want Chrome to be clever and add "http:// http://. By the way, this issues comes from the excessively minimal UI: Chrome should not hide "http:// http:// in the url bar, point-barre. I do not use Evernote because it messes with my selections. I have to use Trello at work but this bully don't even let me select a card title. And the list goes...
- IanCal 14y ago"I have to use Trello at work but this bully don't even let me select a card title." It does if the card is open, are you referring to it assuming you're trying to drag a card on the board view? I'd rather have that than sometimes it drags, sometimes it selects the text.
- gbog 14y agoI mean that when I click on a title Trello assumes I want to edit it. It's that too hard to have a light gray edit icon for that purpose?
- theon144 14y ago>If I select some text and copy it, I am taking a very explicit action. I am giving the computer a very explicit instruction. There is no room for interpretation. It must not disobey me! From the point of view of the browser, it very explicitly does what you told it to, without interpretation, obediently. The problem is that yours and the browser's opinions differ on what you intended to do.
- cmsj 14y agoThen it needs to adjust its worldview to match mine. It showed me some text, I selected the text it showed me. If its simple layout engine thinks I saw some text that was rendered hundreds of pixels outside the viewable area, that is its bug, not mine.
- johnbm 14y agoThere is a way to fix it: don't select text in document order, but only in visual order. Apple does something like this in their PDF reader. This would probably break things people do today, and there would be whining.
- beedogs 14y agoFYI, most of that bullshit "Read More: <URL>" injection garbage can be blocked by adding "tynt.com" to your favorite adblock extension. I believe it's already in ghostery, just not enabled by default. If ever there were a company that just needed to be nuked from orbit, it's tynt.
- Aramgutang 14y agoIf you're using Firefox, you can prevent this kind of behaviour by going into about:config, and setting the dom.event.clipboardevents.enabled flag to false.
- limmeau 14y agoWould that look at the screen layout to remove a span that is positioned too far to the left? Or just disable JS control over copy-paste, which doesn't solve this problem?