mirror of
https://github.com/pi-hole/web.git
synced 2025-12-20 02:38:28 +00:00
Update browserslistc (#3322)
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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") },
|
||||
|
||||
@@ -63,9 +63,6 @@ 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>");
|
||||
|
||||
@@ -83,9 +80,6 @@ function showSuggestDomains(value) {
|
||||
suggestDomainEl.html(table);
|
||||
suggestDomainEl.slideDown("fast");
|
||||
});
|
||||
} catch {
|
||||
hideSuggestDomains();
|
||||
}
|
||||
}
|
||||
|
||||
function hideSuggestDomains() {
|
||||
|
||||
@@ -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);
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user