From f6080131668a73244e261ed004520b8a587f5966 Mon Sep 17 00:00:00 2001 From: Max Ace Date: Tue, 3 Oct 2023 23:55:15 -0400 Subject: [PATCH] first drafts from AI --- content.js | 15 +++++++++++++++ manifest.json | 29 +++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 content.js create mode 100644 manifest.json diff --git a/content.js b/content.js new file mode 100644 index 0000000..4244a62 --- /dev/null +++ b/content.js @@ -0,0 +1,15 @@ +// Check if the current page is the Reservation Information page +// (You might need more specific conditions depending on the page structure.) +if (document.title.includes('Reservation Information')) { + + // Find the element containing the guest's phone number. + // This is a placeholder. You'll need to adjust this based on the actual structure of the webpage. + const phoneNumberElement = document.querySelector('.phone-number-class'); + + if (phoneNumberElement) { + const phoneNumber = phoneNumberElement.textContent.trim(); + + // Send the phone number to the background script for further processing. + chrome.runtime.sendMessage({type: 'CHECK_DNR', phoneNumber: phoneNumber}); + } +} diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..775079e --- /dev/null +++ b/manifest.json @@ -0,0 +1,29 @@ +{ + "manifest_version": 3, + "name": "DNR Advantage", + "version": "1.0", + "description": "Chrome extension for checking guests against a Do Not Rent list.", + "permissions": ["notifications", "activeTab", "storage", "http://*/*", "https://*/*"], + "background": { + "service_worker": "background.js" + }, + "content_scripts": [ + { + "matches": [""], + "js": ["content.js"] + } + ], + "action": { + "default_popup": "popup.html", + "default_icon": { + "16": "icons/icon16.png", + "48": "icons/icon48.png", + "128": "icons/icon128.png" + } + }, + "icons": { + "16": "icons/icon16.png", + "48": "icons/icon48.png", + "128": "icons/icon128.png" + } +}