Fast, private email that's just for you. Try Fastmail free for up to 30 days.
The USPS Postal Store has, for reasons unknown, blocked the ability to copy text from its website.
As a government-run agency, that seems like a terrible idea. Heck, it might even be disallowed under Section 105 of the Copyright Law of the United States (Title 17), which says
Copyright protection under this title is not available for any work of the United States Government….
This suggests there should be no reason for them to prevent copying. Regardless, it pissed me off the other day while writing about the Dungeons & Dragons stamp and I couldn’t easily copy the description.
So I did what any self-respecting geek would do: I worked around the problem.
First, let me acknowledge that the effort I put into addressing this issue, while not much, was still greater than simply retyping the text from the site, or taking a screenshot and copying the text that way. The effort, of course, is beside the point—for geeks like me, it’s never the point. It’s the principle of the matter. Information wants to be free, and I’ll be damned if I can’t copy text on my own computer!
Fortunately, USPS.com made this easy on me by using a method to prevent copying that’s easily worked around: The user-select CSS property.
One of the features of CSS is you can override styles by providing a new style definition. Safari provides a mechanism to add your own style sheet; I’ll use that to override the USPS.com user-select.
(Note: This is Mac- and Safari-specific. While I’m confident there are ways of doing this in other browsers, and on Windows/Android, I don’t use them.)
First, I’ll create a new style sheet that disables the relevant property. Then, I’ll tell Safari to use it. Finally, I’ll reload the page and copy copy copy!
Create a style sheet. user-select tells browsers how to handle content selection. USPS.com sets it to none, preventing any content selection. I want that to be auto—the browser default—which allows selecting—and thus copying—content. I need the !important flag so the browser gives the new definition a higher priority than the one coming from the website. Finally, I want this to apply to everything on the page, so I’ll use * instead of a specific HTML tag, class, or identifier.
I created a file, which I called nof—you.css with the following content:
* {
-webkit-user-select: auto !important;
user-select: auto !important;
}
(Surprisingly, user-select is not a web standard yet, so most browsers prefix it to indicate it’s a browser-specific implementation. -webkit-user-select is for Safari’s current implementation, and user-select is for when the property (eventually) becomes a standard. Other prefixes exist, such as -moz-user-select and -ms-user-select, but again, I care only for Safari.)
Tell Safari to use this style sheet. In Safari, I opened Settings, then the Advanced tab. I opened the Style Sheet popup menu and selected Other…, and chose my nof—you.css file. Safari will now use this css on any web site I load.
Reload the page. After reloading the USPS Store page, I’m now able to select and copy the text.
What’s great is this solution works for any site that uses user-select. I can either leave the CSS file always enabled (so I won’t even notice that a site was blocking selection); or I can disable it (select None from the Style Sheet popup) and re-enable it when necessary.
I think I’ll do the latter so I can emphatically spit out “No f– you!” as I enable it.
Bonus Screenshot Option: I mentioned above taking a screenshot as a way to get around copy blocking. Here’s a brief overview of how you do that. (Again, this is only for Apple systems.) Take a screenshot on your Mac, iPhone or iPad, or take a photo with the Camera. In Photos, use the Live Text feature to select and copy the text. Voila. It still feels like getting away with something, but ultimately, a less visceral f—you! experience.
Your mileage may vary.