From ea7b2005c078dbe862b805a47e5723ba52bbef85 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Mon, 26 Dec 2016 05:25:27 +0000 Subject: 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. --- content_scripts/link_hints.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'content_scripts') 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 -- cgit v1.2.3