From 6c7dc9266158b2f4ca2b470b15d771bee7061340 Mon Sep 17 00:00:00 2001 From: michaelachrisco Date: Fri, 3 May 2024 16:19:50 -0700 Subject: [PATCH] Upload files to "/" --- background.js | 8 ++++++++ content.js | 1 + manifest.json | 17 +++++++++++++++++ popup.html | 16 ++++++++++++++++ 4 files changed, 42 insertions(+) create mode 100644 background.js create mode 100644 content.js create mode 100644 manifest.json create mode 100644 popup.html diff --git a/background.js b/background.js new file mode 100644 index 0000000..0a58818 --- /dev/null +++ b/background.js @@ -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'] + }); + } +}); \ No newline at end of file diff --git a/content.js b/content.js new file mode 100644 index 0000000..df16e75 --- /dev/null +++ b/content.js @@ -0,0 +1 @@ +alert('You are on an Accela website!'); \ No newline at end of file diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..60865dc --- /dev/null +++ b/manifest.json @@ -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/*" + ] + } + \ No newline at end of file diff --git a/popup.html b/popup.html new file mode 100644 index 0000000..525b0dc --- /dev/null +++ b/popup.html @@ -0,0 +1,16 @@ + + + + Accela Alert + + + +

Accela Alert

+

This extension alerts you when you navigate to an Accela website.

+ +