1
Fork 0

Use "strict" mode in JS scripts

This commit is contained in:
Guillaume Gomez 2022-05-02 14:32:56 +02:00
parent 12d3f107c1
commit 1e204ddb3b
6 changed files with 15 additions and 5 deletions

View file

@ -7,6 +7,8 @@
/* global onEach, onEachLazy, removeClass */
/* global switchTheme, useSystemTheme */
"use strict";
if (!String.prototype.startsWith) {
String.prototype.startsWith = function(searchString, position) {
position = position || 0;
@ -292,15 +294,12 @@ function loadCss(cssFileName) {
}
(function() {
"use strict";
function loadScript(url) {
const script = document.createElement('script');
script.src = url;
document.head.append(script);
}
getSettingsButton().onclick = event => {
event.preventDefault();
loadScript(window.settingsJS);