Skip to content
This repository was archived by the owner on Mar 29, 2021. It is now read-only.

Commit 21603ad

Browse files
committed
var -> let
support should long be sufficient
1 parent dd6af7e commit 21603ad

17 files changed

Lines changed: 316 additions & 316 deletions

src/loader.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@
3434
window.location.host === "web1.dawnofthedragons.com" ||
3535
window.location.host === "dotd-web1.5thplanetgames.com"
3636
) {
37-
var f = function() {
38-
console.log("s");
39-
window.idrinth = {};
40-
window.idrinth.add= function(data) {
41-
var s = document.createElement("script");
42-
s.appendChild(document.createTextNode(data));
43-
document.getElementsByTagName("head")[0].appendChild(s);
44-
};
37+
let f = function() {
38+
window.idrinth = {
39+
add: function(data) {
40+
let s = document.createElement("script");
41+
s.appendChild(document.createTextNode(data));
42+
document.getElementsByTagName("head")[0].appendChild(s);
43+
}
44+
};
4545
window.addEventListener(
4646
"message",
4747
function(event) {
4848
try {
49-
var data = JSON.parse(event.data);
49+
let data = JSON.parse(event.data);
5050
if (
5151
!data ||
5252
data.to !== "idotd" ||
@@ -63,13 +63,13 @@
6363
false
6464
);
6565
};
66-
var sc = document.createElement("script");
66+
let sc = document.createElement("script");
6767
sc.setAttribute("id", "idotd-loader");
6868
sc.appendChild(document.createTextNode('('+f.toString()+'());'));
6969
document.getElementsByTagName("head")[0].appendChild(sc);
7070
return;
7171
}
72-
var sc = document.createElement("script");
72+
let sc = document.createElement("script");
7373
sc.setAttribute(
7474
"src",
7575
"https://dotd.idrinth.de/static/userscript/" + GM_info.script.version + "/"
@@ -78,9 +78,9 @@
7878
sc.setAttribute("async", "async");
7979
sc.errorCounter = 0;
8080
sc.errorFunction = function() {
81-
var self = document.getElementById("idotd-loader");
81+
let self = document.getElementById("idotd-loader");
8282
self.parentNode.removeChild(self);
83-
var sc = document.createElement("script");
83+
let sc = document.createElement("script");
8484
sc.onerror = self.onerror;
8585
sc.errorCounter = self.errorCounter + 1;
8686
sc.errorFunction = self.errorFunction;

0 commit comments

Comments
 (0)