summaryrefslogtreecommitdiff
path: root/packages/frontend/src/utility/isWebpSupported.ts
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2025-05-21 07:31:24 +0900
committerGitHub <noreply@github.com>2025-05-21 07:31:24 +0900
commit9480120eba1db238072b0bdfc9e6d01b2494cb3b (patch)
tree3a4d7963e7dd9e540713d6f2b26fc98e2c586223 /packages/frontend/src/utility/isWebpSupported.ts
parentenhance(frontend): URLプレビューをユーザーサイドで無効化で... (diff)
downloadmisskey-9480120eba1db238072b0bdfc9e6d01b2494cb3b.tar.gz
misskey-9480120eba1db238072b0bdfc9e6d01b2494cb3b.tar.bz2
misskey-9480120eba1db238072b0bdfc9e6d01b2494cb3b.zip
Feat: ドライブ周りのUIの強化 (#16011)
* wip * wip * Update MkDrive.vue * wip * Update MkDrive.vue * Update MkDrive.vue * wip * Update MkDrive.vue * Update MkDrive.vue * wip * Update MkDrive.vue * wip * wip * wip * wip * Update MkDrive.vue * wip * wip * wip * wip * wip * wip * wip * feat(frontend): upload dialog (#16032) * wip * wip * Update MkUploadDialog.vue * wip * wip * wip * wip * wip * Update MkUploadDialog.vue * wip * wip * Update MkDrive.vue * wip * wip * Update MkPostForm.vue * wip * Update room.form.vue * Update os.ts * wiop * wip * wip * wip * wip * wip * wip * wip * Update select-file.ts * wip * wip * Update MkDrive.vue * Update drag-and-drop.ts * wip * wip * wop * wip * wip * Update MkDrive.vue * Update CHANGELOG.md * wipo * Update MkDrive.folder.vue * wip * Update MkUploaderDialog.vue * wip * wip * Update MkUploaderDialog.vue * wip * Update MkDrive.vue * Update MkDrive.vue * wip * wip
Diffstat (limited to 'packages/frontend/src/utility/isWebpSupported.ts')
-rw-r--r--packages/frontend/src/utility/isWebpSupported.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/packages/frontend/src/utility/isWebpSupported.ts b/packages/frontend/src/utility/isWebpSupported.ts
new file mode 100644
index 0000000000..affd81fd57
--- /dev/null
+++ b/packages/frontend/src/utility/isWebpSupported.ts
@@ -0,0 +1,15 @@
+/*
+ * SPDX-FileCopyrightText: syuilo and misskey-project
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+
+let isWebpSupportedCache: boolean | undefined;
+export function isWebpSupported() {
+ if (isWebpSupportedCache === undefined) {
+ const canvas = window.document.createElement('canvas');
+ canvas.width = 1;
+ canvas.height = 1;
+ isWebpSupportedCache = canvas.toDataURL('image/webp').startsWith('data:image/webp');
+ }
+ return isWebpSupportedCache;
+}