Reputation: 135
I am looking to import a library into one of my chrome extension's content scripts. Lets take chart.js for instance. I've already looked at this post, but I'm not sure if it is what I need. If it is, then I must be doing something wrong, as I can't seem to get it to work.
I've looked everywhere but I can't seem to find anything regarding the use of libraries in chrome extensions.
Put simply, how can I use and import a javascript library into my chrome extension's content script, so that it can be used in the loaded page?
Thanks, KDJ
What I'm trying now:
manifest.json:
chrome.tabs.executeScript() is what spawns the script in which I'm trying to access the library.
Upvotes: 3
Views: 4326
Reputation: 1
I don't know why but for some libraries it is necessary to remove extension from chrome and add it again.
Upvotes: 0