Skip to content

Commit

Permalink
Added ICO
Browse files Browse the repository at this point in the history
  • Loading branch information
justushar committed Nov 11, 2024
1 parent 8cd3128 commit 912793b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@

"description": "The Phishing Detector extension aims to detect phishing emails using Roberta model trained on multiple datasets to ensure correct predictions.",

"icons": {
"16": "icon.png",
"48": "icon.png",
"128": "icon.png"
},
"action": {
"default_icon": {
"16": "icon.png",
"48": "icon.png",
"128": "icon.png"
}
},

"content_scripts": [
{
"matches": [ "*://mail.google.com/*" ],
Expand Down
8 changes: 4 additions & 4 deletions src/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ const policy = window.trustedTypes.createPolicy("myExtensionPolicy", {
});

async function startExtension(gmail) {
console.log("Extension loading...");
//console.log("Extension loading...");
try {
const tokenizer = await loadTokenizer();
const model = await loadTFJSModel();

console.log("Extension loaded successfully.");
// console.log("Extension loaded successfully.");
window.gmail = gmail;

gmail.observe.on("load", () => {
const userEmail = gmail.get.user_email();
console.log("Hello, " + userEmail + ". This is your extension talking!");
// console.log("Hello, " + userEmail + ". This is your extension talking!");

gmail.observe.on("view_email", async (domEmail) => {
console.log("Looking at email:", domEmail);
Expand Down Expand Up @@ -103,7 +103,7 @@ async function checkSpamInChunks(text, tokenizer, model) {

// Average spam score across chunks and classify as spam if above threshold
const avgSpamScore = spamScoreSum / chunkCount;
console.log("Average spam score:", avgSpamScore);
// console.log("Average spam score:", avgSpamScore);
if (avgSpamScore > 2.77) return "Spam";
else return "Not Spam";
}
Expand Down

0 comments on commit 912793b

Please sign in to comment.