Spaces:
Running
Running
Update index.html
Browse files- index.html +8 -1
index.html
CHANGED
@@ -7,6 +7,11 @@
|
|
7 |
display: none;
|
8 |
}</style></head><body><noscript>This page requires JavaScript.</noscript><input type="file" class="input-for-remembering-project-file" autocomplete="on"><div id="app"></div>
|
9 |
<script>(async function() {
|
|
|
|
|
|
|
|
|
|
|
10 |
const handleBlobLinks = (link) => {
|
11 |
link.addEventListener('click', async (event) => {
|
12 |
event.preventDefault(); // デフォルトのリンク動作をキャンセル
|
@@ -14,6 +19,7 @@
|
|
14 |
|
15 |
try {
|
16 |
const response = await fetch(blobUrl);
|
|
|
17 |
const blob = await response.blob();
|
18 |
|
19 |
// ファイル保存ダイアログを表示
|
@@ -33,7 +39,7 @@
|
|
33 |
alert('ファイルが保存されました!');
|
34 |
} catch (error) {
|
35 |
console.error('エラーが発生しました:', error);
|
36 |
-
alert(
|
37 |
}
|
38 |
});
|
39 |
};
|
@@ -60,6 +66,7 @@
|
|
60 |
|
61 |
alert('Blobリンクの監視を開始しました!');
|
62 |
})();
|
|
|
63 |
</script>
|
64 |
<script>(function() {
|
65 |
// This logic is only for the "splash" screen.
|
|
|
7 |
display: none;
|
8 |
}</style></head><body><noscript>This page requires JavaScript.</noscript><input type="file" class="input-for-remembering-project-file" autocomplete="on"><div id="app"></div>
|
9 |
<script>(async function() {
|
10 |
+
if (typeof window.showSaveFilePicker !== 'function') {
|
11 |
+
alert('このブラウザは showSaveFilePicker をサポートしていません。最新のGoogle Chromeなどをご利用ください。');
|
12 |
+
return;
|
13 |
+
}
|
14 |
+
|
15 |
const handleBlobLinks = (link) => {
|
16 |
link.addEventListener('click', async (event) => {
|
17 |
event.preventDefault(); // デフォルトのリンク動作をキャンセル
|
|
|
19 |
|
20 |
try {
|
21 |
const response = await fetch(blobUrl);
|
22 |
+
if (!response.ok) throw new Error(`HTTPエラー: ${response.status}`);
|
23 |
const blob = await response.blob();
|
24 |
|
25 |
// ファイル保存ダイアログを表示
|
|
|
39 |
alert('ファイルが保存されました!');
|
40 |
} catch (error) {
|
41 |
console.error('エラーが発生しました:', error);
|
42 |
+
alert(`ファイルのダウンロード中にエラーが発生しました: ${error.message}`);
|
43 |
}
|
44 |
});
|
45 |
};
|
|
|
66 |
|
67 |
alert('Blobリンクの監視を開始しました!');
|
68 |
})();
|
69 |
+
|
70 |
</script>
|
71 |
<script>(function() {
|
72 |
// This logic is only for the "splash" screen.
|