We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7f42998 commit 3eb01f3Copy full SHA for 3eb01f3
how-to-make-chrome-extensions/bear/content.js
@@ -6,7 +6,8 @@
6
// })
7
8
const re = new RegExp('bear', 'gi')
9
-const matches = document.documentElement.innerHTML.match(re)
+const matches = document.documentElement.innerHTML.match(re) || []
10
+
11
chrome.runtime.sendMessage({
12
url: window.location.href,
13
count: matches.length
0 commit comments