9 ms·
To anyone who makes sites like these, please consider removing the following CSS rule: https://i.imgur.com/RWqwd0P.png https://i.imgur.com/RWqwd0P.png Thank y
by m1el 7y ago
To anyone who makes sites like these, please consider removing the following CSS rule:
https://i.imgur.com/RWqwd0P.png https://i.imgur.com/RWqwd0P.png
Thank you,
-- someone who thinks selecting text is not something you should screw with.
- icebraining 7y agoIs there even a good reason for the existence of that CSS rule? Browsers should just stop honouring that crap.
- phendrenad2 7y agoThere are, look them up. That said, there's no reason to put it on the whole page like this, other than laziness.
- michaelmcdonald 7y agoWhy on earth would they even do that?! It's just as infuriating as sites that muck around with the scroll. No...just don't. Don't try to be fancy, leave the scrolling to me.
- leppr 7y agoIt's part of making a Progressive Web App: the user should believe they're using a regular smartphone app, and being unable to simply select and copy text goes a long way towards maintaining the illusion. /s
- arkanciscan 7y agoShould we also force our users to download a 30mb update every week? Just to really emulate the native app experience!
- twobat 7y agoThis linked page alone has 10 MB.
- 72deluxe 7y agoInsane and grotesque! Think of all the CPU cycles on all hardware (clients + network devices) and energy used just to fetch web "content" these days. Might as well return to just burning coal at home to keep warm, thinking of the net effect on the environment. It's absolutely stupid.
- smoe 7y agoAnd all the people who don't have $500+ phones, unlimited data plans and fast internet connections. I used a ~$50 android and pre-paid plans for over a year while traveling Latin America. Wast swaths of the internet are basically inaccessible unless you have tremendous patience and nerves as well as leftover money to throw at the ISPs.
- jgalt212 7y agoIt fits with Linus's MO of making videos of how to build computers and systems 10-100X more powerful than you need.
- mhd 7y agoThe neat thing about modern SPAs backed with your average feature-flagged CI/CD setup is that you're getting a new 30 mb download each time.
- kreetx 7y agoI belive you but could you elaborate for those who don't know what you mean? :)
- arkanciscan 7y agoI think they are talking about bundling before code-splitting (like we did back in the Browserify days) and that's true, but we have Webpack, or ESModules now.
- deleted 7y ago[deleted]
- topspin 7y agoOften it's dysfunction; some stake holder or lawyer, etc., having funded the development of some site, observe that one can 'steal' content with copy+paste and freak out, so the front end developers stick this placebo in to shut them up. There are legitimate use cases; the classic being 'sort a table by clicking on a column heading', where without 'user-select: none;' (or some other mitigation) the column heading will often end up being selected. Often when one creates a site that involves users interacting with text using a traditional pointer device outside of form controls a need for this will appear.
- grammarxcore 7y agoFrom personal experience I've seen it mostly pulled out as a solution to an XY problem. Normal text tags give you the text cursor. If you don't want the text cursor, why not disable selection? The proper solution is to just apply the default cursor. I haven't experienced your situation before but that sounds completely reasonable; many non-web devs I know don't even know about the dev console.
- kevin_thibedeau 7y agoW3C gets the ultimate blame. These attributes should not even exist. They should have put their foot down and said no to Google.
- universenz 7y agoPeople with disabilities and accessibility issues (blind, low vision, limited or poor motor function, etc) all have friends and family. These users buy gifts for their friends and families. Sometimes they even buy groceries for themselves. That makes these users your potential customers. Traversing the web for them is already remarkably difficult, but they do it to buy things for their loved ones. When they traverse the web they do so using a multitude of tools including specialised screen readers or keyboard and mouse controllers. Do you know what these users do when they come across your super-aesthetic futuristic website and you hijack the selection functionality for their screen reader? They just bounce to another site or service where selection works. If your site sells something but has been designed for aesthetics only (hijacking the scroll function, removing indicators of selection, disabling right-click functionality etc) you are excluding almost anyone over 50 (that suffers from low vision) and EVERYONE with accessibility requirements. Don't do it. Amazing design is being able to make something aesthetically gorgeous, while also meeting or exceeding as much of the WCAG guidelines as possible. WCAG Guidelines https://www.w3.org/WAI/standards-guidelines/wcag/ https://www.w3.org/WAI/standards-guidelines/wcag/ Source: We're an accessibility accredited and audited design agency.
- DavidVoid 7y agoThe worst imo are sites that mess with how opening links work. Left click should open the link in the current tab and scroll click or Ctrl+left click should open it in new tab (without switching to that tab). Sites that mess with this and refuse to open links in new tabs really annoy me. Thankfully floatplane doesn't seem to change any of that but you can't scroll with Vimium's [udjk] keys which kinda sucks.
- alpaca128 7y agoOh, yes, I also often have that issue(although I use middle mouse click for that). I also have these issues with Vim plugins - suddenly websites make scrolling almost unusable with an animation(which is never seen when scrolling with a mouse, touchpad etc. but seems to exist solely to annoy keyboard users), or they can't be scrolled at all, or the whole website UI is built with crazy JS magic so that the plugin can't even find a single link on the whole page. I don't want to know how bad it must be for blind people who have to rely on automatic tools.
- lewiscollard 7y agoIn fairness, this might have just been an overly-broad solution to a certain problem. That is, if you have an element that is clickable and isn't an <a> or <button>, double clicking it can cause page content to be selected when this was not intended. "user-select" should be disabled more specifically than it is in this case, for sure, but that is what I suspect is really going on here.
- arxpoetica 7y agoIt depends™️. Agree in this case; really bad idea to not let people select text on whole like that. There are tons of of cases, however, where not allowing selected text is totally a good behavior in UI.
- icebraining 7y agoWhen? Can you give an example or two? I was wondering about just that.
- m1el 7y agoAn example where this might be appropriate: using font icons. Selecting an unusable unicode character is not what most users want.
- sli 7y agoI use it for some drag and drop stuff where selecting text would get in the way and would be largely unnecessary (e.g. reordering table columns by dragging a header cell), but that's about it.
- deleted 7y ago[deleted]
- phendrenad2 7y agoNavigational elements, such as a list of clickable links. Gets really annoying when the user is trying to select text, their finger slips and suddenly half the menus on the page are highlighted, and now you need to take into account non-euclidean geometry to get them unhighlighted.
- protonfish 7y agoI've used it on elements with text where click-and-drag and double-click are supposed to be used for a different purpose than text selection.
- Zekio 7y agoCustom buttons that doesn't use the button tag but is made up of a div which has multiple elements like an avatar & a username, icon for a dropdown
- chongli 7y agoWhy can’t we just remove user-hostile features like this from browsers? At this point I’m starting to feel like we need to start over. Create a new web, focused on the user, that doesn’t have any of this nonsense.
- deleted 7y ago[deleted]
- nerdponx 7y agoWhy can’t we just remove user-hostile features like this from browsers I wonder about what kind of a performance decrease you'd expect from being able to blacklist or whitelist chunks of the web API, like how you can blacklist syscalls in some container platforms.
- ygjb 7y agoThere are so many reasons why the web would be awful with granular prefs (and I say this as someone who has wanted it for JS in particular). First off, it depends on how you define your block/allow list. Are they run-time prefs that can be toggled? There is UI/UX overhead, and related attack surface. If they are run-time prefs, are they loaded when the browser is run, or on each page load/content type load? Do you have to maintain a list of prefs by domain? etc, etc, etc. If they are compile time, then is it even worth doing for dramatic increase in complexity trying to support users with unusual configuration (e.g. THAT user that decides that preffing off JSON support is a good idea.) How granular do you allow user prefs on this, and how do you account for the fact that a user may pref off an api/feature that you use as a part of exploit mitigation? Do you want to log entries that are pref'd off so that users know what is making their favorite app fail? What are the abuse cases for pref'd features? How much attack surface is introduced by allowing pref'ing of features? Does doing this actually contribute to usability on the web, or will it simply lead to a proliferation of "Please ensure that all features are pref'd on" pages, similar to the Javascript pages you often see when browsing without javascript.
- Wowfunhappy 7y agoThere's a sibling comment to yours which a number of people replied to, with a pretty good list of situations where you would want to disable text selection.
- sandov 7y agoAnd if I right click on buttons, I can't open in a new tab.
- simulacrumparty 7y agoI made a quick user style to re-enable text selection https://userstyles.org/styles/178336/force-allow-text-selection https://userstyles.org/styles/178336/force-allow-text-select...
- throw0101a 7y agoAlso: as someone who blocks all cookies by default, make sure your site works with them disabled. There is no valid reason why cookies are needed to display HTML.
- recursive 7y agoVery true. Even if that HTML is a document describing an authentication failure.
- johnklos 7y agoSays the person who wants people to load a ridiculously heavy web page that needs a few billion CPU cycles to run Javascript, all to load a tiny image...
- Semaphor 7y agoWhat? This is a direct img link, there is literally 0 javascript.
- Macha 7y agoimgur does some referer detection server side to redirect you to the html page if they think they can. So it's possible that the user is getting sent to the web view.
- Semaphor 7y agoDo you have any source for that? I have never had this happen.
- Macha 7y agoFrom when it was added: https://blog.imgur.com/2017/06/21/a-new-look-for-direct-links/ https://blog.imgur.com/2017/06/21/a-new-look-for-direct-link... The article states that it's been turned back off, but I'm not sure when that edit was. At the very least, here's a report of it happening two months ago: https://old.reddit.com/r/IgnorantImgur/comments/diunko/why_does_imgur_redirect_direct_links/ https://old.reddit.com/r/IgnorantImgur/comments/diunko/why_d...
- Semaphor 7y agoWow, thanks. Not sure about that single reddit thread, but the blog claims they only ran it for a day.
- johnklos 7y agoThe link was updated. Originally it was a full Imgur link.
- choward 7y agoWhenever a site has text selection disabled it raises a huge red flag for me. It's pointless and screams incompetence.
- giancarlostoro 7y agoI only think thats ok for some very specific things like button / input fields where it looks dumb if its selected by mistake. But for content you're immediately reading, it shouldnt be messed with. Maybe you want to take meaninful notes.
- AgloeDreams 7y agoThis makes total sense on UI elements (like buttons and menus) but should never be on content, that rule use here is just lazy.
- retSava 7y agoBookmarklet to re-allow text selection: javascript:(function(){function%20allowTextSelection(){document.onselectstart%20=%20null;%20document.onmousedown%20=%20null;%20document.onmouseup%20=%20null;%20window.console&&console.log('allowTextSelection');var%20style=document.createElement('style');style.type='text/css';style.innerHTML='*,p,div{user-select:text%20!important;-moz-user-select:text%20!important;-webkit-user-select:text%20!important;}';document.head.appendChild(style);var%20elArray=document.body.getElementsByTagName('*');for(var%20i=0;i<elArray.length;i++){var%20el=elArray[i];el.onselectstart=el.ondragstart=el.ondrag=el.oncontextmenu=el.onmousedown=el.onmouseup=function(){return%20true};if(el%20instanceof%20HTMLInputElement&&['text','password','email','number','tel','url'].indexOf(el.type.toLowerCase())>-1){el.removeAttribute('disabled');el.onkeydown=el.onkeyup=function(){return%20true};}}}allowTextSelection();})();
- 52-6F-62 7y agoSomeone could likely trivially publish an extension that just drops * { user-select: unset !important; } into every visited page.
- dayaz36 7y agoHow is this nitpicking over something irrelevant to the primary purpose of their site the top comment on hn?... They just released a video streaming platform...how about we talk about that?
- hoten 7y agoLighthouse is on it: https://github.com/GoogleChrome/lighthouse/issues/10122 https://github.com/GoogleChrome/lighthouse/issues/10122