-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathunlimited.js
37 lines (29 loc) Β· 1.65 KB
/
unlimited.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
(() => {
async function removeCharLimit() {
try {
const searchInput = document.querySelector("#sb_form_q");
if (searchInput) searchInput.removeAttribute("maxlength");
const serp = document.querySelector("#b_sydConvCont > cib-serp");
if (!serp) throw new Error("Elemento cib-serp no encontrado.");
const actionBarMain = serp.shadowRoot.querySelector("#cib-action-bar-main");
if (!actionBarMain) throw new Error("Elemento cib-action-bar-main no encontrado.");
const textInput = actionBarMain.shadowRoot.querySelector("div > div.main-container > div > div.input-row > cib-text-input");
if (!textInput) throw new Error("Elemento cib-text-input no encontrado.");
const textarea = textInput.shadowRoot.querySelector("#searchbox");
if (textarea) {
textarea.removeAttribute("maxlength");
textarea.setAttribute("aria-description", "β");
} else {
throw new Error("Textarea con atributo 'maxlength' no encontrado.");
}
const letterCounter = actionBarMain.shadowRoot.querySelector("div > div.main-container > div > div.bottom-controls > div.bottom-right-controls > div.letter-counter");
if (letterCounter) letterCounter.textContent = "β";
} catch (error) {
console.error("Error:", error.message);
}
}
const initializeExtension = () => removeCharLimit();
setInterval(initializeExtension, 3000);
window.addEventListener("load", initializeExtension);
window.addEventListener("popstate", initializeExtension);
})();