I have a chrome extension on which I want to use the aes-js external library. Specifically, I want to be able to use this library inside my "content.js" file.
I tried adding the library inside script tags in popup.html file and I also tried importing dynamically with require.
manifest.js:
{
"name": "Extension",
"version": "1.0",
"manifest_version": 2,
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["constants.js", "rules.js", "content.js"],
"all_frames": true
}
],
"browser_action": {
"default_popup": "./popup.html",
"default_title": "Extension"
},
"options_page": "./index.html",
"permissions": ["tabs", "*://*/*", "storage"]
}
content.js:
chrome.runtime.onMessage.addListener(function (params, sender, sendResponse) {
// I want to use aes-js here
// Some other code
});