summaryrefslogtreecommitdiff
path: root/packages/frontend/src/scripts
diff options
context:
space:
mode:
authoranatawa12 <anatawa12@icloud.com>2024-04-14 08:08:26 +0900
committerGitHub <noreply@github.com>2024-04-14 08:08:26 +0900
commit48a7679b8a8b3df80d7f90ac6f4a852f47a8df22 (patch)
treec475dec858e1a9e9bc63052cb6cc783701ee1af5 /packages/frontend/src/scripts
parentfix(backend): 登録にメール認証が必須になっている場合、登... (diff)
downloadsharkey-48a7679b8a8b3df80d7f90ac6f4a852f47a8df22.tar.gz
sharkey-48a7679b8a8b3df80d7f90ac6f4a852f47a8df22.tar.bz2
sharkey-48a7679b8a8b3df80d7f90ac6f4a852f47a8df22.zip
test: do not use indexedDB in cypress environment due to chrome bug (#13709)
Diffstat (limited to 'packages/frontend/src/scripts')
-rw-r--r--packages/frontend/src/scripts/idb-proxy.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/frontend/src/scripts/idb-proxy.ts b/packages/frontend/src/scripts/idb-proxy.ts
index 1ca0990ba9..6b511f2a5f 100644
--- a/packages/frontend/src/scripts/idb-proxy.ts
+++ b/packages/frontend/src/scripts/idb-proxy.ts
@@ -15,6 +15,16 @@ const fallbackName = (key: string) => `idbfallback::${key}`;
let idbAvailable = typeof window !== 'undefined' ? !!(window.indexedDB && window.indexedDB.open) : true;
+// iframe.contentWindow.indexedDB.deleteDatabase() がchromeのバグで使用できないため、indexedDBを無効化している。
+// バグが治って再度有効化するのであれば、cypressのコマンド内のコメントアウトを外すこと
+// see https://github.com/misskey-dev/misskey/issues/13605#issuecomment-2053652123
+// eslint-disable-next-line @typescript-eslint/ban-ts-comment
+// @ts-expect-error
+if (window.Cypress) {
+ idbAvailable = false;
+ console.log('Cypress detected. It will use localStorage.');
+}
+
if (idbAvailable) {
await iset('idb-test', 'test')
.catch(err => {