←
Stuart Langridge78,610 posts
Stuart Langridge avatar

Stuart Langridge

@sil

Web consultant and custom developer. Believer in the web. Thou look’st like antichrist, in that lewd hat. He/him. @sil@mastodon.social

◷ Joined March 2007▧ 2,488 Photos and videos
Stuart Langridge avatar
Stuart Langridge@sil·21 Aug 2023

Most of the time, the way you use the sites you build isn't the way that your actual users do. What CSPRO does for you is give you quiet feedback on what your users are experiencing: if your pages load loads of extra JS and pass back user info, you'll know. #stuartwriting 5/6

Stuart Langridge avatar
Stuart Langridge@sil·21 Aug 2023

What this means is that if you set up CSPRO on your page, you get a free audit of what all your third-party resources are loading. Do they pull in extra JS? Are they loading a million extra URLs? Do they pass back info about your users? Now you get to see that! #stuartwriting 4/6

Stuart Langridge avatar
Stuart Langridge@sil·21 Aug 2023

But there's a little-known extra to CSP: the Content-Security-Policy-Report-Only header. With this, if anything on your site tries to load a resource you didn't expect, it won't be denied, but it *will* tell *you* about it with a web hook. #stuartwriting 3/6

Stuart Langridge avatar
Stuart Langridge@sil·21 Aug 2023

The Content Security Policy stuff (called "CSP") in browsers is rather a pain to set up. It's useful for security: basically, you can say "this page is allowed to load X, Y, and Z", and if the page tries to load anything else, it'll be denied. #stuartwriting 2/6

Stuart Langridge avatar
Stuart Langridge@sil·21 Aug 2023

A #WebPrivacy tip. Most web pages use third-party stuff somehow; web fonts, images, videos, JavaScript. It can be useful (and eye-opening for you, the page developer) to see what these things actually do. Do you know about Content-Security-Policy-Report-Only? #stuartwriting 1/6

Stuart Langridge avatar
Stuart Langridge@sil·18 Aug 2023

You can make the "facade" look as much like the actual embedded thing as you want. Most sites that you might want to embed from -- YouTube, TikTok, Twitter -- support oEmbed so you can fetch a machine-readable version of the embedded thing #stuartwriting 3/4

Stuart Langridge avatar
Stuart Langridge@sil·18 Aug 2023

There are a bunch of ways to do this, but the one we're talking about today is called the "facade pattern". Basically, you display something which looks enticing in your page, which when clicked on loads the embedded thing: the video or similar. #stuartwriting 2/4

Stuart Langridge avatar
Stuart Langridge@sil·18 Aug 2023

A #WebPrivacy tip. When you embed a resource from somewhere else on your website -- a video, a tweet, an image, whatever -- you're also aiding the source of that info to track your users around the internet. It's your job to help avoid that. #stuartwriting 1/4

Stuart Langridge avatar
Stuart Langridge@sil·16 Aug 2023

In practice, most developers and most businesses have no need to fingerprint users. If you make people sign in then they identify themselves to you with consent, and in a way they can unilaterally opt out of at any time they choose. This protects their privacy. #stuartwriting 4/5

Stuart Langridge avatar
Stuart Langridge@sil·16 Aug 2023

Browser vendors know that users do not like being tracked, and are continually implementing features to limit fingerprinting. Active fingerprinting techniques are harder because browsers pop up confirmation dialogs: this stops the fingerprinting being covert! #stuartwriting 3/5