I am really new to chrome extension development, and try to use jquery and bootstrap in it. I keep having errors like
ReferenceError: $ is not defined
Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.
Could anyone help me with this? I have put the Jquery before bootstrap, and didn't see that issue if I run it in browser..don't know what goes wrong?
Manifest Json
{
"name": "Stocking",
"version": "1.0.0",
"description": "Chrome extention to keep tracks of stocks' real time movement",
"manifest_version": 2,
"icons":{"128":"icon/icon128.png"},
"permissions": [
"tabs",
"<all_urls>"],
"browser_action":{
"default_icon":{
"16":"icon/icon16.png",
"24":"icon/icon24.png",
"32": "icon/icon32.png"},
"default_popup": "popup.html"
},
"content_scripts": [
{
"matches": [
"<all_urls>"
],
"js": [
"bootstrap-4.4.1-dist/js/jquery-3.3.1.slim.min.js",
"bootstrap-4.4.1-dist/js/bootstrap.bundle.min.js",
"content.js"],
"css":[
"bootstrap-4.4.1-dist/css/bootstrap.min.css"
]
}
],
"background":{
"scripts": [
"bootstrap-4.4.1-dist/js/jquery-3.3.1.slim.min.js",
"bootstrap-4.4.1-dist/js/bootstrap.bundle.min.js",
"background.js"],
"persistent": false
}
popup,html
<body>
<!-- Stocks -->
<div class="btn-group dropleft">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
Dropdown button
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</div>
<!--Search box-->
<div>
<input type="text" name="tickerInput" placeholder="Search ticker symbols...">
<button type="submit" name="add"><i class="fas fa-plus"></i></button>
</div>
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="bootstrap-4.4.1-dist/js/jquery-3.3.1.slim.min.js"></script>
<script src="bootstrap-4.4.1-dist/js/bootstrap.bundle.min.js"></script>
<!-- My JavaScript -->
<script src="js/background.js"></script>
<script src="js/content.js"></script>