I have a chrome extension that have a popup.js file. My main problem is that inside the popup.js file there are 6 functions, and I want to separate these function in multiples JS files and import them in popup.js (mostly for maintenance questions)
Require does not work in my case, does anybody know how to do that ?
manifest.json
{
"name": "xxx",
"version": "1.2.7",
"description": "xxx",
"manifest_version": 2,
"icons": { "128": "0.png" },
"background": {
"scripts": ["background.js"],
"persistent": false
},
"permissions": [
"activeTab",
"storage",
"contextMenus",
"background",
"cookies",
"notifications",
"https://www.linkedin.com/*",
"https://linkedin.com/*"
],
"browser_action": {
"default_popup": "popup.html"
}
}
popup.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="stylesheet" href="style.css" />
</head>
<body>
<h1 class="ui center aligned header ">
<span class="highlighted-orange">HubLinked
</span>
</h1>
</body>
<script type="text/javascript" src="popup.js"></script>
</html>