Re:Look before you paste from a website to terminal
by bjt2n3904 on Thursday January 26, 2017 @08:36AM
(#13491143)
The "fix" to this problem is not to let your browser hook Ctrl+C. Mozilla, if you're listening, could you perhaps make this an option? Or perhaps display a notice if you notice JS hook on Ctrl+C?
[ Parent
| on HN ]
Re:Look before you paste from a website to terminal
by chr1 on Thursday January 26, 2017 @09:04AM
(#13491381)
The example in the article doesn't use javascript, and doesn't hook Ctrl-C, all it uses is simple css.
The problem here is not related to the browsers at all, the problem is on the terminal side, which should not immediately run and random text that was pasted, but should allow editing the pasted text before running.
Re:Look before you paste from a website to terminal
by chaosfox on Thursday January 26, 2017 @11:02AM
(#13492430)
I am not sure the browser is free of blame here, getting invisible characters copied together with the text I selected goes completely against my expectations.
Re:Look before you paste from a website to terminal
by brod on Friday January 27, 2017 @06:58AM
(#13499227)
this could be considered a handy feature in a different scenario, the browser shouldn't be responsible for checking if the text you copied was visible.
Just get a half decent terminal, many have precautions in place for copy/paste.
Re:Look before you paste from a website to terminal
by akerro on Thursday January 26, 2017 @08:44AM
(#13491212)
On zsh I had to press enter manually after pasting the code, before I pasted it I could see 4 lines of code.
Just don't let terminals auto-accept pasted code, require user interaction. That is attack on user from clipboard generally, not from browser on terminal, so why browsers should protect clipboards?