-
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.
- Loading branch information
Showing
11 changed files
with
235 additions
and
16 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,31 @@ | ||
chrome.runtime.sendMessage({message: "fetch_user_data"}, function(response) { | ||
if (response.error) { | ||
console.error('Error:', response.error); | ||
document.body.innerHTML = '<p>Error loading data. Please try again later.</p>'; | ||
} else { | ||
displayUserInfo(response.userData); | ||
displayEmails(response.userEmails); | ||
} | ||
}); | ||
|
||
function displayUserInfo(userData) { | ||
const userInfoDiv = document.getElementById('user-info'); | ||
userInfoDiv.innerHTML = ` | ||
<p>Email: ${userData.email}</p> | ||
<p>Emails sent this month: ${userData.emailsSentThisMonth}</p> | ||
`; | ||
} | ||
|
||
function displayEmails(emails) { | ||
const emailListDiv = document.getElementById('email-list'); | ||
emails.forEach(email => { | ||
const emailDiv = document.createElement('div'); | ||
emailDiv.className = 'email-item'; | ||
emailDiv.innerHTML = ` | ||
<div class="email-subject">${email.subject}</div> | ||
<div class="email-opens">Opened: ${email.numberOfOpens} times</div> | ||
<div>Sent: ${new Date(Number(email.dateAtTimeOfSend)).toLocaleString()}</div> | ||
`; | ||
emailListDiv.appendChild(emailDiv); | ||
}); | ||
} |
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,19 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Email Tracker Summary</title> | ||
<style> | ||
body { width: 300px; font-family: Arial, sans-serif; } | ||
.email-item { margin-bottom: 10px; border-bottom: 1px solid #eee; padding-bottom: 5px; } | ||
.email-subject { font-weight: bold; } | ||
.email-opens { color: #666; } | ||
</style> | ||
</head> | ||
<body> | ||
<h2>Email Tracker Summary</h2> | ||
<div id="user-info"></div> | ||
<h3>Tracked Emails</h3> | ||
<div id="email-list"></div> | ||
<script src="js/popup.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
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 |
---|---|---|
|
@@ -114,4 +114,4 @@ export const privacyPolicyHtml = ` | |
</div> | ||
</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
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 |
---|---|---|
|
@@ -13,4 +13,5 @@ export interface UserData { | |
email: string; | ||
emailsSentThisMonth: number; | ||
lastReset: number; | ||
cached: boolean; | ||
} |
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