-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3-price-tracking-and-monitoring (#12)
* Add price tracking functionality and update manifest permissions * Refactor normalizeContent function to handle numeric content with commas and dots * Refactor element selection and data storage logic * better design * import logik * remove all comments * Add export and import buttons to popup.html and display current selector and selected content in popup.js --------- Co-authored-by: KleinerCodeDrago <[email protected]>
- Loading branch information
1 parent
16ae503
commit 2ae4c9c
Showing
8 changed files
with
312 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Import Data</title> | ||
</head> | ||
<body> | ||
<input type="file" id="fileInput" accept="application/json"> | ||
<script src="import.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
document.getElementById('fileInput').addEventListener('change', (event) => { | ||
const file = event.target.files[0]; | ||
if (!file) return; | ||
|
||
const reader = new FileReader(); | ||
reader.onload = (e) => { | ||
const data = JSON.parse(e.target.result); | ||
browser.runtime.sendMessage({action: "importData", data: data}); | ||
}; | ||
reader.readAsText(file); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
body { | ||
font-family: Arial, sans-serif; | ||
background-color: #f4f4f4; | ||
color: #333; | ||
margin: 0; | ||
padding: 20px; | ||
} | ||
|
||
#container { | ||
background-color: white; | ||
border-radius: 10px; | ||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); | ||
padding: 20px; | ||
max-width: 300px; | ||
margin: auto; | ||
} | ||
|
||
h1, h2 { | ||
color: #2a9d8f; | ||
} | ||
|
||
button { | ||
background-color: #2a9d8f; | ||
color: white; | ||
border: none; | ||
padding: 10px 20px; | ||
border-radius: 5px; | ||
cursor: pointer; | ||
font-size: 1em; | ||
transition: background-color 0.3s; | ||
} | ||
|
||
button:hover { | ||
background-color: #21867a; | ||
} | ||
|
||
p { | ||
line-height: 1.6; | ||
} | ||
|
||
#status { | ||
margin-bottom: 20px; | ||
color: #555; | ||
} | ||
|
||
#selectionInfo, #watchedPrices { | ||
background-color: #eef6f6; | ||
border-radius: 5px; | ||
padding: 10px; | ||
margin-top: 20px; | ||
} | ||
|
||
#currentSelector, #selectedContent { | ||
word-break: break-all; | ||
} |
Oops, something went wrong.