Skip to content

Commit 8965cc8

Browse files
committed
Change innerText to textContent in most places
In all of these cases, we don't care about the visibility properties of innerText.
1 parent 3f4ce86 commit 8965cc8

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

make.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ task("fetch-tlds", [], async () => {
224224
const doc = new DOMParser().parseFromString(text, "text/html");
225225
const els = doc.querySelectorAll("span.domain.tld");
226226
// Each span contains a TLD, e.g. ".com". Trim off the leading period.
227-
const domains = Array.from(els).map((el) => el.innerText.slice(1));
227+
const domains = Array.from(els).map((el) => el.textContent.slice(1));
228228
const str = domains.join("\n");
229229
await Deno.writeTextFile("./resources/tlds.txt", str);
230230
});

pages/action.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ const ActionPage = {
103103
const patternMatchesUrl = this.tabUrl.match(regExp);
104104
if (patternMatchesUrl) {
105105
row.classList.remove("validationError");
106-
validationEl.innerText = "";
106+
validationEl.textContent = "";
107107
} else {
108108
row.classList.add("validationError");
109-
validationEl.innerText = "Pattern does not match the current URL";
109+
validationEl.textContent = "Pattern does not match the current URL";
110110
}
111111
}
112112
},
@@ -123,7 +123,7 @@ const ActionPage = {
123123
const hasBlankPassKeysRule = rules.find((r) => r.passKeys.length == 0);
124124
caption = hasBlankPassKeysRule ? "No" : "Some";
125125
}
126-
document.querySelector("#how-many-enabled").innerText = caption;
126+
document.querySelector("#how-many-enabled").textContent = caption;
127127
},
128128

129129
async onSave() {

pages/hud_page.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ function ensureClipboardIsAvailable() {
8080

8181
const handlers = {
8282
show(data) {
83-
document.getElementById("hud").innerText = data.text;
83+
document.getElementById("hud").textContent = data.text;
8484
document.getElementById("hud").classList.add("vimium-ui-component-visible");
8585
document.getElementById("hud").classList.remove("vimium-ui-component-hidden");
8686
document.getElementById("hud").classList.remove("hud-find");
8787
},
8888
hidden() {
8989
// We get a flicker when the HUD later becomes visible again (with new text) unless we reset its
9090
// contents here.
91-
document.getElementById("hud").innerText = "";
91+
document.getElementById("hud").textContent = "";
9292
document.getElementById("hud").classList.add("vimium-ui-component-hidden");
9393
document.getElementById("hud").classList.remove("vimium-ui-component-visible");
9494
},

pages/options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ const OptionsPage = {
199199
const exampleEl = el.nextElementSibling;
200200
const messageEl = document.createElement("div");
201201
messageEl.classList.add("validation-message");
202-
messageEl.innerText = message;
202+
messageEl.textContent = message;
203203
exampleEl.after(messageEl);
204204
},
205205

0 commit comments

Comments
 (0)