Upload files to "/"

This commit is contained in:
michaelachrisco 2024-05-03 16:19:50 -07:00
commit 6c7dc92661
4 changed files with 42 additions and 0 deletions

8
background.js Normal file
View file

@ -0,0 +1,8 @@
chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
if (changeInfo.status === 'complete' && tab.url.includes('accela.com')) {
chrome.scripting.executeScript({
target: {tabId: tabId},
files: ['content.js']
});
}
});

1
content.js Normal file
View file

@ -0,0 +1 @@
alert('You are on an Accela website!');

17
manifest.json Normal file
View file

@ -0,0 +1,17 @@
{
"manifest_version": 3,
"name": "Accela Alert",
"version": "1.0",
"description": "Alerts users when they navigate to an Accela website.",
"permissions": ["tabs", "scripting","activeTab", "declarativeContent"],
"background": {
"service_worker": "background.js"
},
"action": {
"default_popup": "popup.html"
},
"host_permissions": [
"https://*.accela.com/*"
]
}

16
popup.html Normal file
View file

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<title>Accela Alert</title>
<style>
body {
width: 200px;
padding: 10px;
}
</style>
</head>
<body>
<h2>Accela Alert</h2>
<p>This extension alerts you when you navigate to an Accela website.</p>
</body>
</html>