Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Unified Diff: ios/chrome/browser/find_in_page/resources/find_in_page.js

Issue 2755123002: Fix Find in Page on iOS 10.3. (Closed)
Patch Set: space Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/find_in_page/resources/find_in_page.js
diff --git a/ios/chrome/browser/find_in_page/resources/find_in_page.js b/ios/chrome/browser/find_in_page/resources/find_in_page.js
index 00fa1fd949660a706f8c302cc6c83ded266ebabe..0ae4fec28e912d297c8f25311d2e979e6b2b8467 100644
--- a/ios/chrome/browser/find_in_page/resources/find_in_page.js
+++ b/ios/chrome/browser/find_in_page/resources/find_in_page.js
@@ -953,9 +953,21 @@ __gCrWeb['findInPage'].frameDocuments = function() {
while (windowsToSearch.length != 0) {
var win = windowsToSearch.pop();
for (var i = win.frames.length - 1; i >= 0; i--) {
- if (win.frames[i].document) {
- documents.push(win.frames[i].document);
- windowsToSearch.push(win.frames[i]);
+ // The following try/catch catches a webkit error when searching a page
+ // with iframes. See crbug.com/702566 for details.
+ // To verify that this is still necessary:
+ // 1. Remove this try/catch.
+ // 2. Go to a page with iframes.
+ // 3. Search for anything.
+ // 4. Check if the webkit debugger spits out SecurityError (DOM Exception)
+ // and the search fails. If it doesn't, feel free to remove this.
+ try {
+ if (win.frames[i].document) {
+ documents.push(win.frames[i].document);
+ windowsToSearch.push(win.frames[i]);
+ }
+ } catch (e) {
+ // Do nothing.
}
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698