Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
How to Copy Uncopyable Texts on Windows (howtogeek.com)
75 points by Stratoscope on Nov 13, 2023 | hide | past | favorite | 68 comments


You can make unselectable text on a webpage selectable by going into the browser inspector and disabling any "user-select" or similar CSS property. You can also inject a "user-select: all" into the HTML element containing the text if you can't find which parent element has the "user-select: none".

You can also disable any right click blocking JavaScript or other user-hostile JavaScript in the browser inspector by running JavaScript code in the console to remove any HTML event listeners for right click (typically its oncontextmenu so just set "document.body.oncontextmenu" or "{element that has the property set}.oncontextmenu" to something like null or return true).

*The specific procedure will be slightly different for every site because it is written differently.


In Firefox, shift+right click to bypass anything blocking right click (or providing a non-browser context menu)


I had no idea, thanks for the tip!


Sometimes sites have code that triggers in debug mode and keeps it in a loop. Any tips there, or is the "break and modify source to remove it" the only way?


Disable stopping on breakpoints: https://i.stack.imgur.com/xr0X9.png


One should be able to put code for both removing listeners and adding the CSS override into a bookmarked. That will not trigger the anti-debugging crap.


Add this as bookmarklet i.e. url contents in bookmark:

javascript:(function(){var style=document.createElement('style');style.type='text/css';style.innerHTML='* { user-select: all !important; }';document.head.appendChild(style);document.body.oncontextmenu=function(){return true;};})();

(Untested)


This somehow breaks text selection for me (just selects all text). Here are some useful bookmarklets including a working one to enable right-click and text selection: https://github.com/alanhogan/bookmarklets


Just a note, run them trough https://alanhogan.github.io/bookmarkleter/ before creating the bookmark


> style.type='text/css';

Superfluous. I don’t understand why people often do this on stylesheets or scripts (type="text/javascript"), because it has never at any time been necessary or useful.


Greasemonkey or tampermonkey is a great tool to create scripts (or download them if you don’t know how) to do these tricks automatically.


Why is this even a feature in browsers?


In case you dont want a user selecting some text or you want to implement a custom context menu


Powertoys offer a text extractor tool (among other amazing little utilities)

https://learn.microsoft.com/en-us/windows/powertoys/text-ext...


It's in the article.


Yeah but the article focuses more on a third party app.


The Windows 11 Snipping Tool apparently has OCR as well.


You don't need any third party tools for this any more, OCR is now built in to the Snipping Tool. Just press ctrl+shift+win+s, select the region of the screen you're interested in, then use the new "Copy all text" toolbar button. (Note that this is very new and might not be rolled out to everyone yet)


But Snipping Tool has a message saying they're removing Snipping Tool from Windows and to stop using it...


Isn't that the old snipping tool? Use the shift+win+s instead.


Indeed, the snappy snip tool is being removed, the bloated one remains. Though OCR is a nice addition.


That's a good practical solution but ideally they should just let you copy the text instead of runnign some possibly error prone OCR on it.


Just did the same on Android with Google Keep. Took screenshot, added it to a Google Keep Note, then clicked Grab Image Text.

I am sure same can be done with Google App from Screenshot.


>ctrl+shift+win+s

what was wrong with the Print key?


Are you running Windows 11? I don't see it in Windows 10.


Win 11 and the shortcut is Shift + Win + S.


I don't even run an actual ad blocker and this site is telling me I do. I just block some of the most egregious trackers...

Here's an archive for anyone in the same boat: https://archive.li/tEhOp


Interesting. I do run an adblocker and didn't have any issues


Maybe I should just run one then... some of Safari's privacy settings seem to trigger that "turn off your ad blocker to proceed" on several sites, many of which are frequently on duck duck go's front page for things I search.

archive.ph is usually a perfectly reasonable work-around if I want to read anyway, though.


On my PC, the built-in Windows snipping tool has Text Actions which should do the job too:

https://blogs.windows.com/windows-insider/2023/09/14/new-upd...


Oh the irony - they tried to block the content because of my ad blocker but Safari's reader mode still revealed it anyway.

Not a high quality article either :/


I've seen this site pop up a lot in SERPs too; its content is quite mundane and almost looks like it was LLM-generated.


I remember back in the day Howtogeek used to be a small site ran by a guy who wrote his own How-to tutorials because he was frustrated with the ones out there.

My guess is he probably sold the site at some point


I had no idea that MessageBox let you copy the text to the clipboard! When was this added to Windows?


You're definitely not alone in not knowing this, I have to explain to like 95% of people that this works, is faster, and vastly preferrably over sending me screenshots (or pictures taken by phone) of error dialogs. In their defense: the only way to discover it is word of mouth or just trying it (which I did once). Similar with copying text from terminals.

And a lot of other things which makes using a computer more convenient actually. Especially for the younger generation I have the impression (anecdotally) they lack this "let's find out if I can do this faster/better" mindset. Like: my mum knows basics text stuff on windows like doubleclicking a word selects it, triple clicking selects line/paragraph, ctrl+cursor moves around words and so on. Meanwhile it's painful to see how many people in their twenties only know how to select text by moving the cursor to where they want, clicking and holding, then hunting for the last character and often missing it. I assume the main reason for this is more smartphone/tablet usage, less desktop.


Lack of curiosity is not a generational thing, but here it's pronounced way more


During Windows 2000 development, if insiders are to be believed.

https://weblogs.asp.net/chuckop/110153


I did discover it back in the day by accident, and it must've been Windows 2000 or earlier. Very confused where that came from at first, as it clearly was the contents of some generic message box, but it made no sense why it was in my clipboard in text form. Then I was like "wait a minute, they didn't...." And sure enough after triggering a random message somewhere and pressing ctrl-c I had that very message in my clipboard. Immediately had to tell everybody about it in excitement; nobody knew. Though I remember there being long lines of dashes as separators between the sections instead of those [Title] headings. (Not on Windows anymore for a decade now, so memory is foggy).


It's great. Until you stumble upon done different box where it doesn't work and get annoyed.


On Android, you can open the app switcher, and there you can select text via OCR.


When you are in a hurry or can't install anything:

Shift-Windowskey-S to screensnap an image of the text to the clipboard

Paste in OneNote which is usually there and 'extract text from image'


"Search Image with Google" is now available on right-click in the chrome browser.

You could screenshot -> open JPG in chrome --> and OCR the text.

Takes more clicks than needed but serves me in a pinch currently.

If I am attending a webex/zoom or watching a youtube video that merely "shows" a URL or other text content without offering that to me as copyable text -- this method helps.

Ideally this OCR ability should be a native OS functionality available universally on right-click. Maybe soon.


Person doing the presentation might expect that the link gets shared with specific audience; now it is most probably indexed by Google and publicly searchable.


This drives me up the wall on Android, don't use Windows.

I like to feel that I actually own and control my powerful general purpose computer. Instead I've got a phone that's good for reading HN and not much else.

There shouldn't have to be a discussion on HN on how to select arbitrary text.

/Rant


Oh god, and it's everywhere. Literally would use the YouTube app every now and then with ads to support creators, but being unable to copy video titles, descriptions and comments drive me nuts! Just add "long-press is copy" ffs.

So I guess they want me to keep using the browser version in Firefox with blocked ads.


This is a lot better on Apple products, since the default browser and default screen capture tools offer OCR.


That shouldn't be needed though.

"We are displaying you text that was served to/stored by our program as text, but we won't let you use it as text, unless you jump through the hoop of ocring it"


Windows default screen capture offer OCR too.


In a pinch, iPhone camera is pretty great at grabbing text. Don't even need to take the photo.


I have tried using this feature and found it to be surprisingly lousy. It recognizes the area but can't reliably recognize the text. It's been especially unreliable with random strings of numbers (credit card numbers, phone numbers). Maybe it's better with paragraphs of words, but I've even found it to be pretty so-so for that use case.


Interesting, I've found it to be surprisingly good at random alphanumeric strings, and I use it often for copying teensy model and serial numbers off device stickers.


Odd - works pretty much unfailingly for me - have used it on long random strings - indeed that's where I normally use it.


I’ve personally found the opposite. It absolutely blows me away how good it is, even on crazy graphical fonts or other languages etc. I use it pretty much every single day now.


And if you do take a photo, it’s as good as having saved a text file of whatever you captured. Handy not only for printed docs but also for pulling text from screens you wouldn’t normally be able to copy+paste from.


Not so great with Windows, but shared clipboard means you can use your phone to scan and copy text then instantly paste on MBP or iPad too.

Mac can screenshot and extract as well now, depending on your preference.


Screenshots of web pages or apps that deny selection work well.

Even apps that allow selection but make it a pain, like Craigslist or ChatGPT. Screenshot to photos to select copy is a faster workflow.


For samsung gallery app, one must long press the text to select it on image


On a related note, I recently discovered that the MacOS video player lets you select and copy text from any video you're watching. It's ridiculously cool. I wonder how it works though.


Yes, Apple calls this “Live text”. It is also available on iOS (I think since iOS 15?). You can copy text from photos or videos right from the Photos app.


Honestly microsoft needs to figure out how to copy copyable text in all of their apps. For some reason I always end up with the least intuitive paste when copying text from teams/one note/office but this article does at least help with error messages. Not sure why you can’t just copy it like everything else though.


Not just them. Mobile apps too. ALL TEXT SHOULD BE COPYABLE. Not allowing it is just a shitty time-wasting thing to do.


This is one of the reasons I hate apps of over websites for things like social media. Especially since a lot of them also prevent screenshotting.


Are there any linux (ubuntu) options?


On Linux text I select is automatically placed in a buffer, which gets pasted anywhere with a message ddle click.

That bypasses all the copy restrictions.


xfce4-screenshooter, the default on Xubuntu, has the ability to open it with a program. So download any OCR program in Linux,say tesseract.

Make a script tesseract $1 | xclip -sel c save it as scrocr

And choose this program in xfce4-screenshooter, it'll remember it for next time, keeping the drop-down menu short.

This one copies to clipboard, if you want to view it first, then pipe it to `zenity` or `yad` instead of xclip, one of which im pretty sure is pre-installed in ubuntu. And you can copy it out of there normally after checking it.

If you use gnome etc and not xfce, check comparable options in gnome screenshot tool


Also, you need to use wl-copy instead of xclip on wayland


I use TextSniper on MacOS multiple times a week.


Yet another example of why you should use built-in UI functionality instead of rolling your own.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: