There's now a Firefox extension that does exactly what I wanted, at least for connections to CDNs:
Local emulation of Content Delivery Networks.
Decentraleyes emulates these networks locally by intercepting requests, finding the resource you need and injecting it into the environment. All of this happens instantaneously, automatically and no prior configuration is required.
It could also contain a standard copy of the jquery library, but with custom additions.
So in order for an extension to know whether it was safe to use the local copy rather than the one to be downloaded, it would have to first download it and compare it to the local copy.
This would make the extension useless...