Update browserslistc (#3322)

This commit is contained in:
Adam Warner
2025-03-17 18:05:53 +00:00
committed by GitHub
4 changed files with 22 additions and 41 deletions

View File

@@ -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",

View File

@@ -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") },

View File

@@ -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 = $("<table>");
var parts = new URL(value).hostname.split(".");
var table = $("<table>");
for (var i = 0; i < parts.length - 1; ++i) {
var hostname = parts.slice(i).join(".");
for (var i = 0; i < parts.length - 1; ++i) {
var hostname = parts.slice(i).join(".");
table.append(
$("<tr>")
.append($('<td class="text-nowrap text-right">').text(i === 0 ? "Did you mean" : "or"))
.append($("<td>").append(createButton(hostname)))
);
}
suggestDomainEl.slideUp("fast", function () {
suggestDomainEl.html(table);
suggestDomainEl.slideDown("fast");
});
} catch {
hideSuggestDomains();
table.append(
$("<tr>")
.append($('<td class="text-nowrap text-right">').text(i === 0 ? "Did you mean" : "or"))
.append($("<td>").append(createButton(hostname)))
);
}
suggestDomainEl.slideUp("fast", function () {
suggestDomainEl.html(table);
suggestDomainEl.slideDown("fast");
});
}
function hideSuggestDomains() {

View File

@@ -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);
},
});