summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.vscode/settings.json1
-rw-r--r--dev/lib/dexie-export-import.js17
-rw-r--r--dev/lib/dexie.js5
-rw-r--r--ext/js/pages/settings/backup-controller.js2
-rw-r--r--ext/js/script/dynamic-loader-sentinel.js3
-rw-r--r--ext/js/script/dynamic-loader.js3
6 files changed, 10 insertions, 21 deletions
diff --git a/.vscode/settings.json b/.vscode/settings.json
index aa57bde2..6dea7915 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -6,5 +6,6 @@
"source.fixAll.eslint": true,
},
"eslint.format.enable": true,
+ "javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false,
"javascript.preferences.importModuleSpecifierEnding": "js",
}
diff --git a/dev/lib/dexie-export-import.js b/dev/lib/dexie-export-import.js
deleted file mode 100644
index 8d2ec206..00000000
--- a/dev/lib/dexie-export-import.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright (C) 2023 Yomitan Authors
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- */
-export * from 'dexie-export-import';
diff --git a/dev/lib/dexie.js b/dev/lib/dexie.js
index aa3f2b7d..81a62b28 100644
--- a/dev/lib/dexie.js
+++ b/dev/lib/dexie.js
@@ -14,4 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-export * from 'dexie';
+import Dexie from 'dexie';
+import 'dexie-export-import';
+
+export {Dexie};
diff --git a/ext/js/pages/settings/backup-controller.js b/ext/js/pages/settings/backup-controller.js
index 1ddefa51..2863c505 100644
--- a/ext/js/pages/settings/backup-controller.js
+++ b/ext/js/pages/settings/backup-controller.js
@@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import * as Dexie from '../../../lib/dexie.js';
+import {Dexie} from '../../../lib/dexie.js';
import {isObject, log} from '../../core.js';
import {OptionsUtil} from '../../data/options-util.js';
import {ArrayBufferUtil} from '../../data/sandbox/array-buffer-util.js';
diff --git a/ext/js/script/dynamic-loader-sentinel.js b/ext/js/script/dynamic-loader-sentinel.js
index cb03b0b9..3c06fc02 100644
--- a/ext/js/script/dynamic-loader-sentinel.js
+++ b/ext/js/script/dynamic-loader-sentinel.js
@@ -18,4 +18,5 @@
import {yomitan} from '../yomitan.js';
-yomitan.trigger('dynamicLoaderSentinel', {script: document.currentScript});
+
+yomitan.trigger('dynamicLoaderSentinel', {script: import.meta.url});
diff --git a/ext/js/script/dynamic-loader.js b/ext/js/script/dynamic-loader.js
index ec95ff03..2abc9e04 100644
--- a/ext/js/script/dynamic-loader.js
+++ b/ext/js/script/dynamic-loader.js
@@ -126,6 +126,7 @@ export const dynamicLoader = (() => {
if (node !== null) { continue; }
const script = document.createElement('script');
+ script.type = 'module';
script.async = false;
script.src = url;
parent.appendChild(script);
@@ -140,7 +141,7 @@ export const dynamicLoader = (() => {
const sentinelEventName = 'dynamicLoaderSentinel';
const sentinelEventCallback = (e) => {
- if (e.script !== script) { return; }
+ if (e.script !== script.src) { return; }
yomitan.off(sentinelEventName, sentinelEventCallback);
parent.removeChild(script);
resolve();