Tag Archives: javascript

For those who like hot-linking other people’s code

… life just got a bit safer. Browsers are starting to implement a (relatively easy) way to check integrity of the stuff you hot-link in your code – Chromium is adding this feature now. So that you and your visitors don’t get goatse’d by some mean person on the other end. All you have to do is add this integrity bit to the links you pull from other websites, and you can be sure to always serve – or gracefully fail to do so – the same content no matter what kind of hell breaks loose on that other server:

<script src="https://code.jquery.com/jquery-1.10.2.min.js"
integrity="ni:///sha-256;C6CB9UYIS9UJeqinPHWTHVqh_E1uhG5Twh-Y5qFQmYg?ct=application/javascript">

Ok, so hot-linking jQuery is just lazy, I know, but there is way more third-party code out there than most people realize – stuff like Google Analytics, ads and other widgets are routinely pulled from third-party servers by websites all over the Interwebs, and this is a great first step to add some kind of checks to this mess.