Use "strict" mode in JS scripts
This commit is contained in:
parent
12d3f107c1
commit
1e204ddb3b
6 changed files with 15 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue