-
-
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
30 changed files
with
214 additions
and
416 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
desktop.ini | ||
icons/action.xcf | ||
TODO.txt | ||
.releases | ||
releases/* | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,48 @@ | ||
if (typeof browser == "undefined") { | ||
var browser = chrome; | ||
} | ||
|
||
function updateTheme(tab) { | ||
browser.storage.local.get(null, (item) => { | ||
if (item.isDark === true) { | ||
browser.tabs.sendMessage(tab.id, {isDark:true}) | ||
browser.pageAction.setIcon({ | ||
tabId: tab.id, | ||
path: { | ||
19: "icons/action-19.png", | ||
38: "icons/action-38.png" | ||
} | ||
}); | ||
} | ||
else { | ||
browser.tabs.sendMessage(tab.id, {isDark:false}) | ||
browser.pageAction.setIcon({ | ||
tabId: tab.id, | ||
path: { | ||
19: "icons/action-off-19.png", | ||
38: "icons/action-off-38.png" | ||
} | ||
}); | ||
} | ||
}); | ||
} | ||
|
||
function toggleTheme(tab) { | ||
browser.storage.local.get(null, (item) => { | ||
browser.storage.local.set({ isDark: !item.isDark }); | ||
updateTheme(tab); | ||
}); | ||
} | ||
|
||
function init(tab) { | ||
if (tab.url.includes("pietsmiet.de")) { | ||
updateTheme(tab); | ||
browser.pageAction.show(tab.id); | ||
} | ||
} | ||
|
||
browser.tabs.onUpdated.addListener((id, info, tab) => { | ||
init(tab); | ||
}); | ||
|
||
browser.pageAction.onClicked.addListener(toggleTheme); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
function handleOnInstalled(details) { | ||
let manifest = browser.runtime.getManifest(); | ||
if (details.reason == "install") { | ||
browser.tabs.create({ url: "/onboarding-page.html" }) | ||
} | ||
else if (details.reason == "update") { | ||
let notificationOptions = { | ||
type: "basic", | ||
title: `Version ${manifest.version} Changelog`, | ||
message: `${manifest.name} wurde aktualisiert. Das hat sich geändert: | ||
• Alles wurde komplett neu geschrieben, d.h. alle alten Bugs wurden behoben und (hoffentlich bessere Performance) | ||
• Diese Benachrichtigung wurde eingeführt`, | ||
iconUrl: "icons/icon-48.png" | ||
}; | ||
browser.notifications.create(notificationOptions); | ||
} | ||
} | ||
|
||
browser.runtime.onInstalled.addListener(handleOnInstalled); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,20 @@ | ||
if (typeof browser == "undefined") { | ||
var browser = chrome; | ||
} | ||
|
||
function handleMessage(msg) { | ||
let head = document.head; | ||
let style = document.getElementById("darken-ps"); | ||
if (msg.isDark === true && !style) { | ||
style = document.createElement("link"); | ||
style.href = browser.runtime.getURL("darken_ps.css"); | ||
style.rel = "stylesheet"; | ||
style.id = "darken-ps"; | ||
head.append(style); | ||
} | ||
else if (msg.isDark === false) { | ||
style.remove(); | ||
} | ||
} | ||
|
||
browser.runtime.onMessage.addListener(handleMessage); |
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,38 @@ | ||
:root { | ||
--background-dark: #242424; | ||
--background-darker: #111111; | ||
--pietsmiet-green-dark: #007734; | ||
} | ||
|
||
#creativeAdWrapper { | ||
filter: brightness(0); | ||
} | ||
|
||
body, #app { | ||
background: var(--background-darker) !important; | ||
} | ||
main.container, | ||
.bg-white { | ||
background: var(--background-dark) !important; | ||
color: white !important; | ||
} | ||
.dropdown .bg-white { | ||
background: var(--pietsmiet-green-dark) !important; | ||
color: white !important; | ||
} | ||
|
||
.text-smoke { | ||
color: lightgray !important; | ||
} | ||
.text-smoke-darker{ | ||
color: darkgray !important; | ||
} | ||
|
||
.collapse .more, | ||
.ob-widget-section .ob-widget-header { | ||
color: gray !important; | ||
} | ||
.item.disabled, | ||
.text-muted { | ||
color: dimgray !important; | ||
} |
Oops, something went wrong.