From 034f7938c4bf608a0e56283f741da9a6451777b8 Mon Sep 17 00:00:00 2001 From: Noah Levitt Date: Thu, 20 Dec 2018 10:46:05 -0800 Subject: [PATCH] catch common exception in default behavior --- brozzler/js-templates/umbraBehavior.js.j2 | 8 +++++++- setup.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/brozzler/js-templates/umbraBehavior.js.j2 b/brozzler/js-templates/umbraBehavior.js.j2 index 7c24a13..3d8deaa 100644 --- a/brozzler/js-templates/umbraBehavior.js.j2 +++ b/brozzler/js-templates/umbraBehavior.js.j2 @@ -52,7 +52,13 @@ class UmbraBehavior { var iframes = document.querySelectorAll("iframe"); var iframesLength = iframes.length; for (var i = 0; i < iframesLength; i++) { - documents.push(iframes[i].contentWindow.document); + try { + documents.push(iframes[i].contentWindow.document); + } catch (e) { + // it'd be too much logging because this is common: + // SecurityError: Blocked a frame with origin "..." from accessing a cross-origin frame + // console.log("exception looking at iframe" + iframes[i] + ": " + e); + } } } var documentsLength = documents.length; diff --git a/setup.py b/setup.py index 52e379c..98bcf3e 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ def find_package_data(package): setuptools.setup( name='brozzler', - version='1.5.dev318', + version='1.5.dev319', description='Distributed web crawling with browsers', url='https://github.com/internetarchive/brozzler', author='Noah Levitt',