Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various improvements #104

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ Once installed, open a new tab to see the extension's homepage.

*Note: You can exit fullscreen by pressing ctrl+T after you've set up the shortcuts.*

![image](https://github.com/zkayns/skiovox-helper/assets/80561998/4c09893a-65a5-45da-b70b-5f3d20c27d54)
![image](https://github.com/zkayns/skiovox-helper/assets/80561998/33681af5-7115-4499-b82c-4760d1f468e3)

If you need to install extensions with chromewebstore.google.com blocked, try [Skebstore.](https://github.com/bypassiwastaken/skebstore)
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"manifest_version": 2,
"version": "2.4.1",
"version": "2.4.2",
"name": "Skiovox Helper",
"description": "A helper for the Skiovox exploit -- read more at skiovox.com",
"icons": {
Expand Down Expand Up @@ -100,4 +100,4 @@
"run-at": "document_start"
}
]
}
}
73 changes: 58 additions & 15 deletions new-tab/date-display.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
const DateStyles = {
DEFAULT: 1,
SWAP_MD: 2
}

const DateStyles = ["DEFAULT", "SWAP_MD", "YMD"]
class DateDisplay {
constructor(element) {
this.element = element
this.dateStyle = this.getSavedStyle()
this.validityCheck()
this.render()
this.startInterval()
}
Expand All @@ -25,24 +22,28 @@ class DateDisplay {
year: date.getFullYear()
}

if (this.dateStyle == 2) {
if (this.dateStyle == "1") {
this.element.textContent = [
parts.day, parts.month, parts.year
].join('/')
}
else if (this.dateStyle == "2") {
this.element.textContent = [
parts.month, parts.day, parts.year
].join('/')
} else {
}
else if (this.dateStyle == "3") {
this.element.textContent = [
parts.day, parts.month, parts.year
parts.year, parts.month, parts.day
].join('/')
}
}

onClickedDate() {
if (this.dateStyle === DateStyles.DEFAULT) {
this.dateStyle = DateStyles.SWAP_MD
} else {
this.dateStyle = DateStyles.DEFAULT
} // TODO: fix this middery

this.dateStyle = parseInt(this.dateStyle)+1
if (parseInt(this.dateStyle) > DateStyles.length) {
this.dateStyle = 1
}
this.setSavedStyle(this.dateStyle)
}

Expand All @@ -51,8 +52,50 @@ class DateDisplay {
}

getSavedStyle() {
return Number(localStorage.dateStyle) || DateStyles.DEFAULT
if (localStorage.dateStyle == null) {
autoDetect(chrome.i18n.getUILanguage())
}
return localStorage.dateStyle || "1"
}

validityCheck() {
if (parseInt(this.dateStyle) < 1) {
//this.autoDetect(chrome.i18n.getUILanguage())
this.dateStyle = "1";
}
if (typeof this.dateStyle === 'string' || this.dateStyle instanceof String) {
// ok cool
} else {
if (this.dateStyle = DateStyles.DEFAULT) {
this.dateStyle = "1"
}
else if (this.dateStyle = DateStyles.SWAP_MD) {
this.dateStyle = "2"
}
else if (this.dateStyle = DateStyles.YMD) {
this.dateStyle = "3"
}
}
this.setSavedStyle(this.dateStyle)
}
}

export { DateDisplay }
/*const dmyLangs = ["el", "ml", "en-GB", "en-AU", "ca", "es", "es-419", "pt-BR", "pt-PT", "ro", "ru", "th", "kn", "mr", "uk", "pl", "ar", "fil", "he"]
const mdyLangs = ["en-US"]
const ymdLangs = ["ko", "vi", "zh-CN", "zh-TW", "sv", "sw"]*/
/*autoDetect(lang) {
if (this.dmyLangs.find(lang) > 0) {
this.dateStyle = "1"
} else if (this.mdyLangs.find(lang) > 0) {
this.dateStyle = "2"
} else if (this.ymdLangs.find(lang) > 0) {
this.dateStyle = "3"
} else {
this.dateStyle = "1"
}
this.setSavedStyle(this.dateStyle)
this.getSavedStyle()
this.render()
}
}*/
12 changes: 8 additions & 4 deletions new-tab/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<body>
<div class="top-left">
<div class="name">Skiovox Helper</div> <span class="version"></span>
<div class="name" style="font: 22px monospace;">Skiovox Helper</div> <span class="version"></span>
</div>
<div class="icon-corner top-right">
<svg xmlns="http://www.w3.org/2000/svg" viewbox="0 -960 960 960">
Expand Down Expand Up @@ -38,8 +38,8 @@
</div>
<div class="center">
<div class="date"></div>
<div class="time"></div>
<div class="battery"></div>
<div class="time" style="font: 55px monospace;"></div>
<div class="battery" style="font: 15px monospace;"></div>
</div>
<div class="icon-corner bottom-left">
<svg xmlns="http://www.w3.org/2000/svg" viewbox="0 -960 960 960">
Expand Down Expand Up @@ -72,7 +72,11 @@
<path
d="m370-80-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm112-260q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Z" />
</svg>
<svg xmlns="http://www.w3.org/2000/svg" viewbox="0.5 0.5 15 15">
<path
d="M7 5.222V0h2v5.193l1.107-1.107L11.52 5.5 7.986 9.036 4.45 5.5l1.414-1.414L7 5.222zM16 11v5H0v-5h2v3h12v-3h2z"/>
</svg>
</div>
</body>

</html>
</html>
8 changes: 7 additions & 1 deletion new-tab/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const FILES_URL = "chrome://file-manager";
const HELP_URL = "https://github.com/bypassiwastaken/skiovox-helper";
const WEBSTORE_URL = "https://chromewebstore.google.com";
const ADDSESSION_URL = "https://accounts.google.com/signin/v2/identifier?hl=en&continue=https%3A%2F%2Fwww.google.com%2F&ec=GAlAmgQ&flowName=GlifWebSignIn&flowEntry=AddSession";
const DOWNLOADS_URL = "chrome://downloads";

let [
help,
Expand All @@ -26,7 +27,8 @@ let [
wifi,
bluetooth,
files,
settings
settings,
downloads
] = document.querySelectorAll('svg')

let version = document.querySelector('.version')
Expand All @@ -48,6 +50,10 @@ settings.addEventListener('click', () => {
chrome.tabs.create({ url: SETTINGS_URL })
})

downloads.addEventListener('click', () => {
chrome.tabs.create({ url: DOWNLOADS_URL })
})

theme.addEventListener('click', () => {
alert("The original New Tab page will now open. On that page, click the edit icon in the bottom right corner to edit your browser theme.")
chrome.tabs.create({ url: NEW_TAB_URL })
Expand Down
1 change: 1 addition & 0 deletions new-tab/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ body {

.battery {
font-size: 15px;
margin-top: -10px;
}

svg {
Expand Down