Skip to content
This repository was archived by the owner on Feb 17, 2021. It is now read-only.

Commit e5f3892

Browse files
committed
Merge pull request #94 from yeah/master
Catch exceptions caused by illegal selectors with document.querySelector
2 parents f928e51 + a6ebebc commit e5f3892

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/js/hopscotch.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,9 @@
359359
return result.length ? result[0] : null;
360360
}
361361
if (document.querySelector) {
362-
return document.querySelector(target);
362+
try {
363+
return document.querySelector(target);
364+
} catch (err) {}
363365
}
364366
// Regex test for id. Following the HTML 4 spec for valid id formats.
365367
// (http://www.w3.org/TR/html4/types.html#type-id)

0 commit comments

Comments
 (0)