Upload files to "/"
This commit is contained in:
commit
6c7dc92661
4 changed files with 42 additions and 0 deletions
8
background.js
Normal file
8
background.js
Normal 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
1
content.js
Normal file
|
@ -0,0 +1 @@
|
|||
alert('You are on an Accela website!');
|
17
manifest.json
Normal file
17
manifest.json
Normal 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
16
popup.html
Normal 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>
|
Loading…
Reference in a new issue