I have created a Chrome extension for an e-gym that is designed to prompt a confirm window after every hour of using the Chrome browser. The issue I am facing is that the confirm window only appears on popup.html. I want to activate my extension so that it generates a window.confirm on any tab I am currently using after one hour. Here is the code I have implemented:
manifest.json:
{
"name" : "E-Gym ScreenSaver",
"description": "Build an Extension!",
"version": "1.0",
"manifest_version": 3,
"background": { "service_worker": "background.js" },
"permissions": ["storage",
"scripting",
"tabs",
"webNavigation",
"notifications", "activeTab", "contextMenus"],
"host_permissions": [
"http://*/",
"https://*/"
],
"chrome_url_overrides" : {
"newtab": "storyboard_break_time.html"
},
"action": {
"default_popup": "popup.html"
}
}
popup.html:
<!DOCTYPE html>
<html>
<head><link rel="stylesheet" href="storyboardstyle.css"></head>
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="187a77776c6b6c6a7968582d3629362b">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet">
<body style="width: 280px; height: 150px; ">
<div id="heading-gympass"><h2><b>E-GYM</b></h2>
<button id="start_btn"></button><div>
<script src="popup.js"></script>
</body>
</html>
popup.js:
// code implementation
I would greatly appreciate any assistance with this task. My ultimate goal is to display the confirm window on any tab I am actively using after one hour of browsing. As a temporary measure, I have set this functionality to activate every 10 seconds for testing purposes.
My desired outcome is to have a confirm window appear on any tab I am using after one hour has elapsed.