-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from badsgahhl/v2.1-list-feature
V2.1 list feature Closes #7
- Loading branch information
Showing
14 changed files
with
469 additions
and
42 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
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,3 @@ | ||
#!/bin/bash | ||
|
||
rm package.zip | ||
|
||
zip -r package.zip dist/ icon/ src/ manifest.json -x "*.ts" | ||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,12 @@ | ||
export enum ApiListMode | ||
{ | ||
whitelist = 'white', | ||
blacklist = 'black', | ||
} | ||
|
||
export interface PiHoleVersions | ||
{ | ||
FTL_current: string; | ||
web_current: string; | ||
core_current: string; | ||
} |
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
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,44 @@ | ||
import {StorageAccessService} from "./StorageAccessService.js"; | ||
|
||
export module TabService | ||
{ | ||
/** | ||
* Returns the current tab url. Cleaned only the real domain without the parameters etc. | ||
*/ | ||
export async function get_current_tab_url_cleaned(): Promise<string> | ||
{ | ||
const current_tab_url_promise: Promise<string> = new Promise((resolve) => { | ||
chrome.tabs.query({'active': true, 'lastFocusedWindow': true, 'currentWindow': true}, function(tabs) { | ||
if (tabs[0]) | ||
{ | ||
const url = tabs[0].url; | ||
resolve(url); | ||
} | ||
}); | ||
}); | ||
let url = ''; | ||
let full_url = (await current_tab_url_promise); | ||
const url_validity_regex = new RegExp('^(http|https):\\/\\/[^ "]+$'); | ||
const pi_hole_url = (await StorageAccessService.get_pi_hole_settings()).pi_uri_base; | ||
|
||
// Domains that should not be listed anyway. | ||
const excluded_domains: Array<string> = [ | ||
new URL(pi_hole_url).hostname, | ||
'localhost', | ||
'127.0.0.1', | ||
'pi.hole' | ||
] | ||
// Checking regex | ||
if (url_validity_regex.test(full_url)) | ||
{ | ||
const hostname = new URL(full_url).hostname; | ||
// Check if url is on the excluded list | ||
if (!excluded_domains.includes(hostname)) | ||
{ | ||
url = hostname | ||
} | ||
} | ||
return url; | ||
} | ||
|
||
} |
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
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,10 +1,28 @@ | ||
* { | ||
--black-mode-background: #2b3943; | ||
--black-mode-color-light-blue-grey: #94a6bf; | ||
--black-mode-background-light: #334b5b; | ||
} | ||
|
||
@media (prefers-color-scheme: dark) { | ||
body { | ||
background: var(--black-mode-background) !important; | ||
background: var(--black-mode-background); | ||
color: white !important; | ||
} | ||
|
||
.card-header { | ||
background: var(--black-mode-background); | ||
} | ||
|
||
.card-body { | ||
background: var(--black-mode-background-light); | ||
} | ||
|
||
.card-footer { | ||
background: var(--black-mode-background); | ||
} | ||
|
||
.card { | ||
border-color: var(--black-mode-color-light-blue-grey); | ||
} | ||
} |
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
Oops, something went wrong.