From 26b64adca64f16b371833b0c45ba05d3ffa96a18 Mon Sep 17 00:00:00 2001 From: Huang Xin Date: Sun, 9 Feb 2025 00:54:06 +0100 Subject: [PATCH] fix: add blob CSP for font and don't override

margin by default (#327) * android: add fullscreen theme * fix: add blob CSP for font and don't override

margin by default, closes #320 --- .../gen/android/app/src/main/res/values/themes.xml | 9 +++++++++ apps/readest-app/src-tauri/tauri.conf.json | 2 +- apps/readest-app/src/utils/style.ts | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 apps/readest-app/src-tauri/gen/android/app/src/main/res/values/themes.xml diff --git a/apps/readest-app/src-tauri/gen/android/app/src/main/res/values/themes.xml b/apps/readest-app/src-tauri/gen/android/app/src/main/res/values/themes.xml new file mode 100644 index 00000000..448c59cd --- /dev/null +++ b/apps/readest-app/src-tauri/gen/android/app/src/main/res/values/themes.xml @@ -0,0 +1,9 @@ + + + + diff --git a/apps/readest-app/src-tauri/tauri.conf.json b/apps/readest-app/src-tauri/tauri.conf.json index 5626b071..085705ab 100644 --- a/apps/readest-app/src-tauri/tauri.conf.json +++ b/apps/readest-app/src-tauri/tauri.conf.json @@ -18,7 +18,7 @@ "connect-src": "'self' blob: data: asset: http://asset.localhost ipc: http://ipc.localhost https://*.sentry.io https://*.posthog.com https://*.deepl.com https://*.wikipedia.org https://*.wiktionary.org https://*.supabase.co https://*.readest.com wss://speech.platform.bing.com https://*.cloudflarestorage.com", "img-src": "'self' blob: data: asset: http://asset.localhost https://*", "style-src": "'self' 'unsafe-inline' blob: asset: http://asset.localhost https://cdn.jsdelivr.net https://fonts.googleapis.com", - "font-src": "'self' data: asset: http://asset.localhost tauri: https://fonts.gstatic.com https://db.onlinewebfonts.com https://cdn.jsdelivr.net", + "font-src": "'self' blob: data: asset: http://asset.localhost tauri: https://fonts.gstatic.com https://db.onlinewebfonts.com https://cdn.jsdelivr.net", "frame-src": "'self' blob: asset: http://asset.localhost", "script-src": "'self' 'unsafe-inline' 'unsafe-eval' blob: asset: http://asset.localhost https://*.sentry.io https://*.posthog.com" }, diff --git a/apps/readest-app/src/utils/style.ts b/apps/readest-app/src/utils/style.ts index a9f2e66b..279d122d 100644 --- a/apps/readest-app/src/utils/style.ts +++ b/apps/readest-app/src/utils/style.ts @@ -167,7 +167,7 @@ const getLayoutStyles = ( background-color: transparent !important; } p, li, blockquote, dd { - margin: ${paragraphMargin}em 0 !important; + margin: ${paragraphMargin}em 0; line-height: ${lineSpacing} !important; word-spacing: ${wordSpacing}px !important; letter-spacing: ${letterSpacing}px !important;