| 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"; |