In my Chrome extension my Javascript content script is inserting a script tag into the page. However when I run it, it is trying to request the file from the website instead of locally. It errors on the get request. How can I have the content script find the file in the extension instead of asking the website for it?
Content script runs in the page context, and relative url will be treated as server url.
chrome.extension.getURL(string path) will give your content script an url path to access your extension's files. https://developer.chrome.com/extensions/extension#method-getURL
You also have to give those files permission to be used from content script with "web_accessible_resources" in manifest.json