diff --git a/package.json b/package.json index 0575b75a..53195623 100644 --- a/package.json +++ b/package.json @@ -61,8 +61,11 @@ "xo": "^0.60.0" }, "browserslist": [ - "defaults", - "not IE 11" + ">= 0.5%", + "last 2 major versions", + "not dead", + "not op_mini all", + "Firefox ESR" ], "prettier": { "arrowParens": "avoid", diff --git a/scripts/js/gravity.js b/scripts/js/gravity.js index 26573246..5547d141 100644 --- a/scripts/js/gravity.js +++ b/scripts/js/gravity.js @@ -10,20 +10,11 @@ function eventsource() { var alSuccess = $("#alSuccess"); var ta = $("#output"); - // https://caniuse.com/fetch - everything except IE - // This is fine, as we dropped support for IE a while ago - if (typeof fetch !== "function") { - ta.show(); - ta.html("Updating lists of ad-serving domains is not supported with this browser!"); - return; - } - ta.html(""); ta.show(); alInfo.show(); alSuccess.hide(); - // eslint-disable-next-line compat/compat fetch("/api/action/gravity", { method: "POST", headers: { "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content") }, diff --git a/scripts/js/groups-domains.js b/scripts/js/groups-domains.js index 8c8f86e5..5bf623b2 100644 --- a/scripts/js/groups-domains.js +++ b/scripts/js/groups-domains.js @@ -63,29 +63,23 @@ function showSuggestDomains(value) { var newDomainEl = $("#new_domain"); var suggestDomainEl = $("#suggest_domains"); - try { - // URL is not supported in all browsers, but we are in a try-block so we can ignore it - // eslint-disable-next-line compat/compat - var parts = new URL(value).hostname.split("."); - var table = $("
| ').text(i === 0 ? "Did you mean" : "or")) - .append($(" | ").append(createButton(hostname))) - ); - } - - suggestDomainEl.slideUp("fast", function () { - suggestDomainEl.html(table); - suggestDomainEl.slideDown("fast"); - }); - } catch { - hideSuggestDomains(); + table.append( + $(" |
| ').text(i === 0 ? "Did you mean" : "or")) + .append($(" | ").append(createButton(hostname))) + ); } + + suggestDomainEl.slideUp("fast", function () { + suggestDomainEl.html(table); + suggestDomainEl.slideDown("fast"); + }); } function hideSuggestDomains() { diff --git a/scripts/js/settings-teleporter.js b/scripts/js/settings-teleporter.js index bae997b0..7cadcc32 100644 --- a/scripts/js/settings-teleporter.js +++ b/scripts/js/settings-teleporter.js @@ -20,13 +20,6 @@ function importZIP() { return; } - // https://caniuse.com/fetch - everything except IE - // This is fine, as we dropped support for IE a while ago - if (typeof fetch !== "function") { - alert("Importing Tricorder files is not supported with this browser!"); - return; - } - // Get the selected import options const imports = {}, gravity = {}; @@ -44,7 +37,7 @@ function importZIP() { const formData = new FormData(); formData.append("import", JSON.stringify(imports)); formData.append("file", file); - // eslint-disable-next-line compat/compat + fetch("/api/teleporter", { method: "POST", body: formData, @@ -93,14 +86,14 @@ $("#GETTeleporter").on("click", function () { }, success: function (data, status, xhr) { var a = document.createElement("a"); - // eslint-disable-next-line compat/compat var url = globalThis.URL.createObjectURL(data); + a.href = url; a.download = xhr.getResponseHeader("Content-Disposition").match(/filename="([^"]*)"/)[1]; document.body.append(a); a.click(); a.remove(); - // eslint-disable-next-line compat/compat + globalThis.URL.revokeObjectURL(url); }, }); |