I have written a Chrome extension which modifies the appearance of an external website (not accessible to me on the server side). The content.js file is written in jQuery and it works fine as long as I keep a copy of the jQuery API in the root of the extension's folder, and declare the file's name under "content_scripts": "matches": in the extension's manifest.json file. But it shouldn't be necessary to use a local file, should it? Can't I link to https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js instead? In this post, it is suggested to add the link under "content_scripts": "matches": but that will not work.
I thought this would be a really basic problem and that the answer would be something obvious and heavily upvoted, but I can't find anything like that here. Sorry If it's because I'm thick.
options.jsfile also uses jQuery, but here linking to the remote URL is used via modification of the manifest'scontent_security_policyto"script-src 'self' https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js; object-src 'self'". Is that relaxation of the CSP also a bad idea?options.jsto use the jquery file. I guess it's something in the manifest, or do I have to change something else? I would rather not paste the entire jquery file intooptions.js.<script>tag to load jquery.js