MCPcopy
hub / github.com/philc/vimium / showValidationErrors

Function showValidationErrors

pages/action.js:97–112  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

95 },
96
97 showValidationErrors() {
98 const rows = document.querySelectorAll(".rule");
99 for (const row of rows) {
100 const pattern = row.querySelector("input[name=pattern]").value;
101 const regExp = this.getPatternRegExp(pattern);
102 const validationEl = row.querySelector(".validationMessage");
103 const patternMatchesUrl = this.tabUrl.match(regExp);
104 if (patternMatchesUrl) {
105 row.classList.remove("validationError");
106 validationEl.textContent = "";
107 } else {
108 row.classList.add("validationError");
109 validationEl.textContent = "Pattern does not match the current URL";
110 }
111 }
112 },
113
114 showExclusionRulesEditor() {
115 document.querySelector("#exclusions-container").style.display = "block";

Callers

nothing calls this directly

Calls 2

matchMethod · 0.80
removeMethod · 0.80

Tested by

no test coverage detected