mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-01 13:27:08 +02:00
23 lines
809 B
TypeScript
23 lines
809 B
TypeScript
import { Player } from "../Player";
|
|
import { Exploit } from "./Exploit";
|
|
|
|
(function () {
|
|
function clickTheUnclickable(event: MouseEvent): void {
|
|
if (!event.target || !(event.target instanceof Element)) return;
|
|
const display = window.getComputedStyle(event.target as Element).display;
|
|
if (display === "none" && event.isTrusted) Player.giveExploit(Exploit.Unclickable);
|
|
}
|
|
|
|
function targetElement(): void {
|
|
const elem = document.getElementById("unclickable");
|
|
if (elem == null) {
|
|
console.error("Could not find the unclickable elem for the related exploit.");
|
|
return;
|
|
}
|
|
elem.addEventListener("click", clickTheUnclickable);
|
|
document.removeEventListener("DOMContentLoaded", targetElement);
|
|
}
|
|
|
|
document.addEventListener("DOMContentLoaded", targetElement);
|
|
})();
|