Skip to content

Commit

Permalink
Catch window.find exception in FF for Android, fixes #1438
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanhughes committed Feb 5, 2015
1 parent a4e4103 commit 0823e2e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions feature-detects/css/hyphens.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,15 @@ define(['Modernizr', 'prefixes', 'createElement', 'testAllProps', 'addTest'], fu
}

/* try to find the doubled testword, without the delimiter */
if (window.find) {
result = window.find(testword + testword);
} else {
try {
try {
if (window.find) {
result = window.find(testword + testword);
} else {
textrange = window.self.document.body.createTextRange();
result = textrange.findText(testword + testword);
} catch(e) {
result = false;
}
} catch(e) {
result = false;
}

document.body.removeChild(div);
Expand Down

0 comments on commit 0823e2e

Please sign in to comment.