For some reason, there was some code that wasn’t working for my phone. I of course, added eruda to the site, but some people found it annoying. A dev tools visible on a production site? What?! So I made this snippet to allow me to use devtools by adding ?devtools
var params = new URLSearchParams(window.location.search);
if (typeof params.get("devtools") == "string") {
window.addEventListener("DOMContentLoaded", (event) => {
var script = document.createElement("script");
script.src = "https://cdn.jsdelivr.net/npm/eruda";
document.body.appendChild(script);
script.onload = function () {
eruda.init();
};
});
}
Also, I didn’t wanna make a full project so I wanted to make a “snippet” type of thing (idea from @keithk)