mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-08-08 06:22:23 -04:00
Merge branch 'no-skipIframes' into qa
This commit is contained in:
commit
bf8bbfba27
3 changed files with 9 additions and 12 deletions
|
@ -25,8 +25,6 @@
|
||||||
url_regex: '^https?://(?:www\.)?instagram\.com/.*$'
|
url_regex: '^https?://(?:www\.)?instagram\.com/.*$'
|
||||||
behavior_js_template: umbraBehavior.js.j2
|
behavior_js_template: umbraBehavior.js.j2
|
||||||
default_parameters:
|
default_parameters:
|
||||||
interval: 500
|
|
||||||
skip_iframes: true
|
|
||||||
actions:
|
actions:
|
||||||
- selector: button.coreSpriteDismissLarge
|
- selector: button.coreSpriteDismissLarge
|
||||||
- selector: 'a>.eLAPa>.KL4Bh'
|
- selector: 'a>.eLAPa>.KL4Bh'
|
||||||
|
|
|
@ -26,11 +26,6 @@ class UmbraBehavior {
|
||||||
this.idleSince = null;
|
this.idleSince = null;
|
||||||
this.intervalId = null;
|
this.intervalId = null;
|
||||||
this.intervalTimeMs = {{interval or 300}};
|
this.intervalTimeMs = {{interval or 300}};
|
||||||
{% if skip_iframes %}
|
|
||||||
this.skipIframes = true;
|
|
||||||
{% else %}
|
|
||||||
this.skipIframes = false;
|
|
||||||
{% endif %}
|
|
||||||
this.index = 0;
|
this.index = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,11 +43,15 @@ class UmbraBehavior {
|
||||||
|
|
||||||
var documents = [];
|
var documents = [];
|
||||||
documents[0] = document;
|
documents[0] = document;
|
||||||
if (!(this.skipIframes)) {
|
var iframes = document.querySelectorAll("iframe");
|
||||||
var iframes = document.querySelectorAll("iframe");
|
var iframesLength = iframes.length;
|
||||||
var iframesLength = iframes.length;
|
for (var i = 0; i < iframesLength; i++) {
|
||||||
for (var i = 0; i < iframesLength; i++) {
|
try {
|
||||||
documents.push(iframes[i].contentWindow.document);
|
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;
|
var documentsLength = documents.length;
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -32,7 +32,7 @@ def find_package_data(package):
|
||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name='brozzler',
|
name='brozzler',
|
||||||
version='1.5.dev317',
|
version='1.5.dev319',
|
||||||
description='Distributed web crawling with browsers',
|
description='Distributed web crawling with browsers',
|
||||||
url='https://github.com/internetarchive/brozzler',
|
url='https://github.com/internetarchive/brozzler',
|
||||||
author='Noah Levitt',
|
author='Noah Levitt',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue