mirror of
https://github.com/searxng/searxng.git
synced 2025-07-12 07:49:22 +02:00
*Not so safe* changes, no behaviour changes. - More ES5 to ES2015+ conversion. - Make Biome not cry anymore applying remaining changes.
19 lines
556 B
JavaScript
19 lines
556 B
JavaScript
/* SPDX-License-Identifier: AGPL-3.0-or-later */
|
|
((w, d) => {
|
|
// add data- properties
|
|
const getLastScriptElement = () => {
|
|
const scripts = d.getElementsByTagName("script");
|
|
return scripts[scripts.length - 1];
|
|
};
|
|
|
|
const script = d.currentScript || getLastScriptElement();
|
|
|
|
w.searxng = {
|
|
settings: JSON.parse(atob(script.getAttribute("client_settings")))
|
|
};
|
|
|
|
// update the css
|
|
const htmlElement = d.getElementsByTagName("html")[0];
|
|
htmlElement.classList.remove("no-js");
|
|
htmlElement.classList.add("js");
|
|
})(window, document);
|