When running shadowbox on a site where the shadowbox_auto.js file loads and the site is displayed in an iframe, it fails on the following line of code if ($('iframe#sb-player', top.document).length == 0) {. This is because it is not actually the top level document and therefore causes a cross-domain policy request issue (unless they are framed in the same domain obviously).

A simple remedy is to wrap this in a try catch as if it fails we shouldn't do any applying of shadowbox code anyway (based on the current implementation). I think top.document ultimately needs replaced with just document but I'm not sure why the context of the iframe look up is in there in the first place, hence, work around so that js keeps running at least.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

btopro’s picture

Status: Needs work » Needs review
FileSize
1.69 KB

patch