mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-02-24 00:29:53 -05:00
Add iframe css path to target id for soundcloud buttons.
This commit is contained in:
parent
e9451f88d8
commit
91f9788eb2
@ -84,7 +84,8 @@ var umbraIntervalFunc = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//try to detect sound cloud "Play" buttons and return them as targets for clicking
|
//try to detect sound cloud "Play" buttons and return them as targets for clicking
|
||||||
var getUmbraSoundCloudEmbeddedElements = function(soundCloudEmbeddedElements, currentIframeDepth, currentDocument) {
|
var getUmbraSoundCloudEmbeddedElements = function(soundCloudEmbeddedElements, currentIframeDepth, currentDocument,
|
||||||
|
iframeElement) {
|
||||||
|
|
||||||
//set default values for parameters
|
//set default values for parameters
|
||||||
currentIframeDepth = currentIframeDepth || 0;
|
currentIframeDepth = currentIframeDepth || 0;
|
||||||
@ -99,8 +100,10 @@ var getUmbraSoundCloudEmbeddedElements = function(soundCloudEmbeddedElements, cu
|
|||||||
|
|
||||||
button = currentDocument.querySelectorAll(UMBRA_THINGS_TO_CLICK_SOUNDCLOUD_EMBEDDED_SELECTOR);
|
button = currentDocument.querySelectorAll(UMBRA_THINGS_TO_CLICK_SOUNDCLOUD_EMBEDDED_SELECTOR);
|
||||||
|
|
||||||
|
var cssPathIframe = iframeElement ? getElementCssPath(iframeElement) : "";
|
||||||
|
|
||||||
for (var i = 0; i < button.length; i++) {
|
for (var i = 0; i < button.length; i++) {
|
||||||
soundCloudEmbeddedElements.push({"id" : getElementCssPath(button.item(i)), "target" : button.item(i)});
|
soundCloudEmbeddedElements.push({"id" : cssPathIframe + getElementCssPath(button.item(i)), "target" : button.item(i)});
|
||||||
}
|
}
|
||||||
|
|
||||||
//now get all buttons in embedded iframes
|
//now get all buttons in embedded iframes
|
||||||
@ -109,7 +112,7 @@ var getUmbraSoundCloudEmbeddedElements = function(soundCloudEmbeddedElements, cu
|
|||||||
iframe = currentDocument.querySelectorAll(UMBRA_IFRAME_SOUNDCLOUD_EMBEDDED_SELECTOR);
|
iframe = currentDocument.querySelectorAll(UMBRA_IFRAME_SOUNDCLOUD_EMBEDDED_SELECTOR);
|
||||||
|
|
||||||
for (var i = 0; i < iframe.length; i++) {
|
for (var i = 0; i < iframe.length; i++) {
|
||||||
getUmbraSoundCloudEmbeddedElements(soundCloudEmbeddedElements, currentIframeDepth + 1, iframe[i].contentWindow.document.body);
|
getUmbraSoundCloudEmbeddedElements(soundCloudEmbeddedElements, currentIframeDepth + 1, iframe[i].contentWindow.document.body, iframe[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user