diff --git a/.eslintrc.yml b/.eslintrc.yml index c0a4f6808..cbb60e03e 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -1,9 +1,9 @@ --- root: true parserOptions: - ecmaVersion: 2018 + ecmaVersion: 2022 env: - es6: true + es2022: true browser: true jquery: true webextensions: true @@ -50,7 +50,6 @@ parserOptions: sourceType: module globals: - BigInt: readonly _: readonly XKit: writable XBridge: writable diff --git a/manifest.json b/manifest.json index ce9ba8305..08147396f 100644 --- a/manifest.json +++ b/manifest.json @@ -27,7 +27,7 @@ "128": "icon.png" }, "manifest_version": 2, - "minimum_chrome_version": "44.0", + "minimum_chrome_version": "103.0", "name": "New XKit", "author": "New XKit Team", "permissions": ["storage", "unlimitedStorage", "*://*.tumblr.com/*", "https://new-xkit.github.io/XKit/*", "https://cloud.new-xkit.com/*" ], @@ -36,6 +36,7 @@ "applications": { "gecko": { "id": "@new-xkit", + "strict_min_version": "115.0", "update_url": "https://new-xkit.github.io/XKit/Extensions/dist/page/FirefoxUpdate.json" } } diff --git a/xkit.js b/xkit.js index 91399fac1..60d054121 100755 --- a/xkit.js +++ b/xkit.js @@ -4391,7 +4391,7 @@ function show_message(title, msg, icon, buttons) { }); } -function xkit_init_special() { +async function xkit_init_special() { $("body").html(""); document.title = "XKit"; @@ -4417,11 +4417,8 @@ function xkit_init_special() { if (document.location.href.indexOf("/xkit_editor") !== -1) { if (typeof(browser) !== 'undefined') { - var xhr = new XMLHttpRequest(); - xhr.open('GET', browser.extension.getURL('editor.js'), false); - xhr.send(null); try { - new Function(xhr.responseText + "\n//# sourceURL=xkit/editor.js")(); + await import(browser.runtime.getURL("/editor.js")); XKit.extensions.xkit_editor.run(); } catch (e) { XKit.window.show("Can't launch XKit Editor", "

" + e.message + "

", "error", "
OK
");