diff --git a/materialious/android/app/build.gradle b/materialious/android/app/build.gradle index 8557a778..171c0631 100644 --- a/materialious/android/app/build.gradle +++ b/materialious/android/app/build.gradle @@ -7,8 +7,8 @@ android { applicationId "us.materialio.app" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 154 - versionName "1.10.13" + versionCode 155 + versionName "1.10.14" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" aaptOptions { // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. diff --git a/materialious/electron/materialious.metainfo.xml b/materialious/electron/materialious.metainfo.xml index eac2a1f5..04c82877 100644 --- a/materialious/electron/materialious.metainfo.xml +++ b/materialious/electron/materialious.metainfo.xml @@ -71,7 +71,11 @@ - + + + https://github.com/Materialious/Materialious/releases/tag/1.10.14 + + https://github.com/Materialious/Materialious/releases/tag/1.10.13 diff --git a/materialious/electron/package.json b/materialious/electron/package.json index 2ef9144a..8e3769b8 100644 --- a/materialious/electron/package.json +++ b/materialious/electron/package.json @@ -1,6 +1,6 @@ { "name": "Materialious", - "version": "1.10.13", + "version": "1.10.14", "description": "Modern material design for Invidious.", "author": { "name": "Ward Pearce", diff --git a/materialious/package.json b/materialious/package.json index 91c42b3c..7ed0b774 100644 --- a/materialious/package.json +++ b/materialious/package.json @@ -1,6 +1,6 @@ { "name": "materialious", - "version": "1.10.13", + "version": "1.10.14", "private": true, "scripts": { "dev": "vite dev", diff --git a/materialious/src/lib/android/http/androidRequests.ts b/materialious/src/lib/android/http/androidRequests.ts index 21d549c4..24d6fada 100644 --- a/materialious/src/lib/android/http/androidRequests.ts +++ b/materialious/src/lib/android/http/androidRequests.ts @@ -1,12 +1,12 @@ -import { goto } from '$app/navigation'; -import { isAndroidTvStore } from '$lib/store'; +import { timeout } from '$lib/misc'; import { Capacitor } from '@capacitor/core'; import { NodeJS } from 'capacitor-nodejs'; -import { get } from 'svelte/store'; const originalFetch = window.fetch; const corsProxyUrl: string = 'http://localhost:3000/'; +let nodejsStarted = false; + function needsProxying(target: string): boolean { if (!target.startsWith('http')) return false; return true; @@ -16,6 +16,19 @@ export const androidFetch = async ( requestInput: string | URL | Request, requestOptions?: RequestInit ): Promise => { + // On initial request pause until OPTIONS request passes on local proxy, only reliable way + // to ensure proxy is working on android. + if (!nodejsStarted) { + let testResp: Response | undefined = undefined; + while (typeof testResp === 'undefined' || !testResp.ok) { + try { + testResp = await originalFetch(corsProxyUrl, { method: 'OPTIONS' }); + } catch (error) {} + await timeout(100); + } + nodejsStarted = true; + } + const uri = requestInput instanceof Request ? requestInput.url : requestInput.toString(); if (needsProxying(uri)) { @@ -54,17 +67,4 @@ if (Capacitor.getPlatform() === 'android') { /* @ts-ignore */ return originalXhrOpen.apply(this, args); }; - - NodeJS.whenReady().then(() => { - goto('/', { replaceState: true }); - }); - - // Required for Android TV to load correctly. - let hasReloaded = false; - isAndroidTvStore.subscribe((isAndroidTv) => { - if (hasReloaded || !isAndroidTv) return; - hasReloaded = true; - - setTimeout(() => goto('/', { replaceState: true }), 2000); - }); } diff --git a/materialious/src/lib/components/Settings/About.svelte b/materialious/src/lib/components/Settings/About.svelte index da909131..6d1fffe5 100644 --- a/materialious/src/lib/components/Settings/About.svelte +++ b/materialious/src/lib/components/Settings/About.svelte @@ -16,12 +16,6 @@ }); -

- Materialious is a modern material design frontend for Invidious, focused on a clean, - privacy-friendly YouTube experience. It supports local video fallback when Invidious fails and is - available on Web, Desktop, Android, and Android TV. -

-