Skip to content

Commit

Permalink
Added icons
Browse files Browse the repository at this point in the history
  • Loading branch information
getvictor committed Jun 30, 2024
1 parent d3bb62a commit bcba09f
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 8 deletions.
5 changes: 1 addition & 4 deletions src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ function startUp() {
if (data.mode && typeof data.mode === "object") {
currentModeIndex = (data.mode as Mode).index
}
void chrome.action.setBadgeText({ text: MODES[currentModeIndex].text })
void chrome.action.setBadgeBackgroundColor({
color: MODES[currentModeIndex].color,
})
void chrome.action.setIcon({ path: MODES[currentModeIndex].icon })
})
}

Expand Down
3 changes: 3 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export interface Mode {
id: string
text: string
color: string
icon: string
}

export interface Message {
Expand All @@ -24,12 +25,14 @@ export const MODES: Mode[] = [
id: "off",
text: "off",
color: "#AAAAAA",
icon: "blurry_gray_16.png",
},
{
index: 1,
id: "on",
text: "blur",
color: "#008C20",
icon: "blurry_green_16.png",
},
]

Expand Down
6 changes: 2 additions & 4 deletions src/popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ chrome.storage.sync.get(null, (data) => {
const config = data as StoredConfig
checkbox.checked = !(config.mode?.id === "off")
const mode = config.mode ?? MODES[1]
void chrome.action.setBadgeText({ text: mode.text })
void chrome.action.setBadgeBackgroundColor({ color: mode.color })
void chrome.action.setIcon({ path: mode.icon })
const literals: string[] = config.literals ?? []

// Loop over NUMBER_OF_LITERALS elements and listen to each one.
Expand Down Expand Up @@ -57,8 +56,7 @@ checkbox.addEventListener("change", (event) => {
if (event.target instanceof HTMLInputElement) {
const mode = event.target.checked ? MODES[1] : MODES[0]
void chrome.storage.sync.set({ mode: mode })
void chrome.action.setBadgeText({ text: mode.text })
void chrome.action.setBadgeBackgroundColor({ color: mode.color })
void chrome.action.setIcon({ path: mode.icon })
// Send message to content script in all tabs
chrome.tabs
.query({})
Expand Down
Binary file added static/blurry_gray_16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/blurry_green_16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/blurry_purple_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/blurry_purple_48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions static/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"name": "OpenBlur",
"version": "0.5.0",
"description": "Hide and blur sensitive information on any webpage. Blur your secrets such as personal emails, public IP addresses, and more.",
"icons": {
"48": "blurry_purple_48.png",
"128": "blurry_purple_128.png"
},
"action": {
"default_popup": "popup.html"
},
Expand Down

0 comments on commit bcba09f

Please sign in to comment.