an example of chrome extension, which can be opened as new tab by click its browser icon.
forked from @akirattii
<html>
<head>
<meta charset="utf-8">
<title>example-app</title>
</head>
<body class="container mx-auto pb-4">
<div>Hello chrome extension!<div>
<!-- extension require -->
<script src="extlib/js/jquery-3.3.1.min.js"></script>
<link rel="stylesheet" href="extlib/css/bootstrap.min.css">
<script src="extlib/js/bootstrap.min.js"></script>
<!-- import popup.js -->
<script src="popup.js"></script>
</body>
</html>
console.log(`[LOG] - popup.js`);
if ($) {
console.log(`[LOG] - jquery-available`);
}
// here can use jQuery...
console.log(`[LOG] - background.js`);
chrome.browserAction.onClicked.addListener(function(tab) {
chrome.tabs.create({
'url': chrome.extension.getURL('popup.html')
}, function(tab) {
// Tab opened.
});
});
console.log(`[LOG] - content.js`);