Ainât no party like a third party
This was originally posted on my own site.
Iâd like to tell you something not to do to make your website better. Donât add any third-party scripts to your site.
That may sound extreme, but at one time it wouldâve been common sense. On todayâs modern web it sounds like advice from a tinfoil-hat wearing conspiracy nut. But just because Iâm paranoid doesnât mean theyâre not out to get your userâs data.
All Iâm asking is that we treat third-party scripts like third-party cookies. They were a mistake.
Browsers are now beginning to block third-party cookies. Chrome is dragging its heels because the same company that makes the browser also runs an advertising business. But even they canât resist the tide. Third-party cookies are used almost exclusively for tracking. That was never the plan.
In the beginning, there was no state on the web. A client requested a resource from a server. The server responded. Then they both promptly forgot about it. That made it hard to build shopping carts or log-ins. Thatâs why we got cookies.
In hindsight, cookies shouldâve been limited to a same-origin policy from day one. That wouldâve solved the problems of authentication and commerce without opening up a huge security hole that has been exploited to track people as they moved from one website to another. The web went from having no state to having too much.
Now that vulnerability is finally being closed. But only for cookies. I would love it if third-party JavaScript got the same treatment.
When you add any third-party file to your website â an image, a style sheet, a font â itâs a potential vector for tracking. But third-party JavaScript files go one further. They can execute arbitrary code.
Just take a minute to consider the implications of that: any third-party script on your site is allowing someone else to execute code on your web pages. Thatâs astonishingly unsafe.
It gets better. One of the pieces of code that this invited intruder can execute is the ability to pull in other third-party scripts.
You might think thereâs no harm in adding that one little analytics script. Or that one little Google Tag Manager snippet. Itâs such a small piece of code, after all. But in doing that, youâve handed over your keys to a stranger. And now theyâre welcoming in all their shady acquaintances.
Request Map Generator is a great tool for visualizing the resources being loaded on any web page. Try pasting in the URL of an interesting article from a news outlet or magazine that someone sent you recently. Then marvel at the sheer size and number of third-party scripts that sneak in via one tiny script
element on the original page.
Thatâs why I recommend that the one thing people can do to make their website better is to not add third-party scripts.
Easier said than done, right? Especially if youâre working on a site that currently relies on third-party tracking for its business model. But that exploitative business model wonât change unless people like us are willing to engage in a campaign of passive resistance.
I know, I know. If you refuse to add that third-party script, your boss will probably say, âFine, Iâll get someone else to do it. Also, youâre fired.â
This tactic will only work if everyone agrees to do whatâs right. We need to have one anotherâs backs. We need to support one another. The way people support one another in the workplace is through a union.
So I think Iâd like to change my answer to the question thatâs been posed.
The one thing people can do to make their website better is to unionize.
This was originally posted on my own site.