diff options
| author | Stephen Blott | 2016-12-26 05:25:27 +0000 |
|---|---|---|
| committer | Stephen Blott | 2016-12-26 05:25:27 +0000 |
| commit | ea7b2005c078dbe862b805a47e5723ba52bbef85 (patch) | |
| tree | 2482e691e3391fb977e50ed504ff8f701ab28a7f | |
| parent | 351489c7c5e093531aa8cd5870a3f78c99fb2923 (diff) | |
| download | vimium-ea7b2005c078dbe862b805a47e5723ba52bbef85.tar.bz2 | |
Guard against element.tagName not being a string.
Example page: http://codeforces.com/contest/752/problem/B.
There, `element.tagName` is an element with `name` `tagName` (not a string). Here, we guard against that case.
Fixes #2305.
| -rw-r--r-- | content_scripts/link_hints.coffee | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee index 706e4dd5..ac069c3c 100644 --- a/content_scripts/link_hints.coffee +++ b/content_scripts/link_hints.coffee @@ -626,7 +626,9 @@ LocalHints = # image), therefore we always return a array of element/rect pairs (which may also be a singleton or empty). # getVisibleClickable: (element) -> - tagName = element.tagName.toLowerCase() + # Get the tag name. However, `element.tagName` can be an element (not a string, see #2305), so we guard + # against that. + tagName = element.tagName.toLowerCase?() ? "" isClickable = false onlyHasTabIndex = false possibleFalsePositive = false |
