diff --git a/Chromium (Manifest v3)/android-chrome-192x192.png b/Chromium (Manifest v3)/android-chrome-192x192.png new file mode 100644 index 0000000..f868ec3 Binary files /dev/null and b/Chromium (Manifest v3)/android-chrome-192x192.png differ diff --git a/Chromium (Manifest v3)/background.js b/Chromium (Manifest v3)/background.js new file mode 100644 index 0000000..afff1a7 --- /dev/null +++ b/Chromium (Manifest v3)/background.js @@ -0,0 +1,22 @@ +chrome.action.onClicked.addListener(function (tab) { + const input = tab.url; + const formattedInput = doubleEncodeURL(input); + const link = formattedInput ? `https://www.virustotal.com/gui/search/${formattedInput}` : null; + + if (link) { + openInNewTab(link); + } +}); + +const openInNewTab = (url) => { + chrome.tabs.create({ url: url }); +}; + +const doubleEncodeURL = (input) => { + try { + const url = new URL(input); + return encodeURIComponent(encodeURIComponent(url.href)); + } catch (error) { + return null; + } +}; diff --git a/Chromium (Manifest v3)/favicon-16x16.png b/Chromium (Manifest v3)/favicon-16x16.png new file mode 100644 index 0000000..7ac0108 Binary files /dev/null and b/Chromium (Manifest v3)/favicon-16x16.png differ diff --git a/Chromium (Manifest v3)/favicon-32x32.png b/Chromium (Manifest v3)/favicon-32x32.png new file mode 100644 index 0000000..cf702d1 Binary files /dev/null and b/Chromium (Manifest v3)/favicon-32x32.png differ diff --git a/Chromium (Manifest v3)/manifest.json b/Chromium (Manifest v3)/manifest.json new file mode 100644 index 0000000..43385c3 --- /dev/null +++ b/Chromium (Manifest v3)/manifest.json @@ -0,0 +1,17 @@ +{ + "manifest_version": 3, + "name": "VirusTotal Website Security Check", + "version": "1.0", + "description": "Automatically opens a VirusTotal website scan page on the URL you are visiting right now, in just a click of a button.", + "permissions": ["activeTab"], + "background": { + "service_worker": "background.js" + }, + "action": { + "default_icon": { + "16": "favicon-16x16.png", + "32": "favicon-32x32.png", + "192": "android-chrome-192x192.png" + } + } +} diff --git a/Firefox (Manifest v2)/android-chrome-192x192.png b/Firefox (Manifest v2)/android-chrome-192x192.png new file mode 100644 index 0000000..f868ec3 Binary files /dev/null and b/Firefox (Manifest v2)/android-chrome-192x192.png differ diff --git a/Firefox (Manifest v2)/background.js b/Firefox (Manifest v2)/background.js new file mode 100644 index 0000000..6e9da2e --- /dev/null +++ b/Firefox (Manifest v2)/background.js @@ -0,0 +1,22 @@ +chrome.browserAction.onClicked.addListener(function (tab) { + const input = tab.url; + const formattedInput = doubleEncodeURL(input); + const link = formattedInput ? `https://www.virustotal.com/gui/search/${formattedInput}` : null; + + if (link) { + openInNewTab(link); + } +}); + +const openInNewTab = (url) => { + chrome.tabs.create({ url: url }); +}; + +const doubleEncodeURL = (input) => { + try { + const url = new URL(input); + return encodeURIComponent(encodeURIComponent(url.href)); + } catch (error) { + return null; + } +}; diff --git a/Firefox (Manifest v2)/favicon-16x16.png b/Firefox (Manifest v2)/favicon-16x16.png new file mode 100644 index 0000000..7ac0108 Binary files /dev/null and b/Firefox (Manifest v2)/favicon-16x16.png differ diff --git a/Firefox (Manifest v2)/favicon-32x32.png b/Firefox (Manifest v2)/favicon-32x32.png new file mode 100644 index 0000000..cf702d1 Binary files /dev/null and b/Firefox (Manifest v2)/favicon-32x32.png differ diff --git a/Firefox (Manifest v2)/manifest.json b/Firefox (Manifest v2)/manifest.json new file mode 100644 index 0000000..75dbad9 --- /dev/null +++ b/Firefox (Manifest v2)/manifest.json @@ -0,0 +1,23 @@ +{ + "manifest_version": 2, + "name": "VirusTotal Website Security Check", + "version": "1.0", + "description": "Automatically opens a VirusTotal website scan page on the URL you are visiting right now, in just a click of a button.", + "icons": { + "16": "favicon-16x16.png", + "32": "favicon-32x32.png", + "192": "android-chrome-192x192.png" + }, + "permissions": ["activeTab"], + "background": { + "scripts": ["background.js"], + "persistent": false + }, + "browser_action": { + "default_icon": { + "16": "favicon-16x16.png", + "32": "favicon-32x32.png", + "192": "android-chrome-192x192.png" + } + } +}