Skip to content
This repository was archived by the owner on Apr 30, 2026. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions chrome/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,35 +18,35 @@ chrome.runtime.onMessage.addListener(function(message, sender) {

if(message == 'disabled')
{
chrome.browserAction.setIcon({path:"icons/icon-disabled-48.png"});
//chrome.browserAction.setBadgeText({text: "-"});
chrome.browserAction.setBadgeBackgroundColor({ color: [55, 55, 55, 255] });
chrome.action.setIcon({path:"icons/icon-disabled-48.png"});
// chrome.action.setBadgeText({text: "-"});
chrome.action.setBadgeBackgroundColor({ color: [55, 55, 55, 255] });
}
else if(message == 'enabled')
{
chrome.browserAction.setIcon({path:"icons/icon-48.png"});
chrome.browserAction.setBadgeText({text: ""});
chrome.action.setIcon({path:"icons/icon-48.png"});
chrome.action.setBadgeText({text: ""});
}
else if(message == 'reenabled')
{
chrome.browserAction.setIcon({path:"icons/icon-reenabled-48.png"});
chrome.browserAction.setBadgeText({text: ""});
chrome.browserAction.setBadgeBackgroundColor({ color: [255, 65, 54, 255] });
chrome.action.setIcon({path:"icons/icon-reenabled-48.png"});
chrome.action.setBadgeText({text: ""});
chrome.action.setBadgeBackgroundColor({ color: [255, 65, 54, 255] });
}
else if(isNaN(message) === false)
{
// Only go to this block if message is a number

if(message != "0")
{
chrome.browserAction.setBadgeText({text: message, tabId: sender.tab.id});
chrome.browserAction.setBadgeBackgroundColor({ color: [255, 65, 54, 255] });
// Not a Chrome function and default is already white text
//chrome.browserAction.setBadgeTextColor({color: [255,255,255,255]});
chrome.action.setBadgeText({text: message, tabId: sender.tab.id});
chrome.action.setBadgeBackgroundColor({ color: [255, 65, 54, 255] });
// Default is already white text
// chrome.action.setBadgeTextColor({color: [255,255,255,255]});
}
else
{
//chrome.browserAction.setBadgeText({text: "", tabId: sender.tab.id});
chrome.action.setBadgeText({text: "", tabId: sender.tab.id});
}

}
Expand Down
4 changes: 2 additions & 2 deletions chrome/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ function filter_css(selectors, selectorcss)
// Update background.js with bagde count
block_count++;
}
chrome.extension.sendMessage(block_count.toString());
chrome.runtime.sendMessage(block_count.toString());
}


Expand Down Expand Up @@ -815,7 +815,7 @@ window.addEventListener("DOMContentLoaded", function() {
(items.domainsettingsdb[domain] == DOMAIN_SETTINGS_DO_SCAN_NO_SANITIZE) )
{
// Zero out badge
chrome.extension.sendMessage(block_count.toString());
chrome.runtime.sendMessage(block_count.toString());


if(items.domainsettingsdb[domain] == DOMAIN_SETTINGS_DO_SCAN_NO_SANITIZE)
Expand Down
18 changes: 10 additions & 8 deletions chrome/manifest.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
{
"manifest_version": 2,
"manifest_version": 3,

"name": "CSS Exfil Protection",
"version": "1.1.0",
"description": "Guard against CSS data exfiltration attacks.",

"content_security_policy": "script-src 'self'; object-src 'self'; style-src 'self'",
"content_security_policy": {
"script-src": "self",
"object-src": "self",
"style-src": "self"
},

"permissions": [
"http://*/",
"https://*/",
"storage",
"tabs"
],
"host_permissions": ["<all_urls>"],

"homepage_url": "https://www.mike-gualtieri.com/css-exfil-vulnerability-tester",
"icons": {
Expand All @@ -23,16 +26,15 @@
"128": "icons/icon-128.png"
},

"browser_action": {
"action": {
"default_icon": {
"48": "icons/icon-48.png"
},
"default_popup": "popup.html"
},

"options_ui": {
"page": "popup.html",
"chrome_style": true
"page": "popup.html"
},

"content_scripts": [{
Expand All @@ -43,7 +45,7 @@
}],

"background": {
"scripts": ["background.js"]
"service_worker": "background.js"
}

}