diff --git a/README.md b/README.md index bf82bb3..9d32408 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/manifest.json b/manifest.json index a1a0d5d..34b43e7 100644 --- a/manifest.json +++ b/manifest.json @@ -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": { @@ -100,4 +100,4 @@ "run-at": "document_start" } ] -} \ No newline at end of file +} diff --git a/new-tab/date-display.js b/new-tab/date-display.js index 91e14cf..6dbe2b0 100644 --- a/new-tab/date-display.js +++ b/new-tab/date-display.js @@ -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() } @@ -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) } @@ -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() + } +}*/ diff --git a/new-tab/main.html b/new-tab/main.html index 4533722..1800464 100644 --- a/new-tab/main.html +++ b/new-tab/main.html @@ -10,7 +10,7 @@
-
Skiovox Helper
+
Skiovox Helper
@@ -38,8 +38,8 @@
-
-
+
+
@@ -72,7 +72,11 @@ + + +
- \ No newline at end of file + diff --git a/new-tab/main.js b/new-tab/main.js index 33056f6..63f73d0 100644 --- a/new-tab/main.js +++ b/new-tab/main.js @@ -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, @@ -26,7 +27,8 @@ let [ wifi, bluetooth, files, - settings + settings, + downloads ] = document.querySelectorAll('svg') let version = document.querySelector('.version') @@ -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 }) diff --git a/new-tab/style.css b/new-tab/style.css index 5bc8d65..71c068d 100644 --- a/new-tab/style.css +++ b/new-tab/style.css @@ -67,6 +67,7 @@ body { .battery { font-size: 15px; + margin-top: -10px; } svg {