html - Selecting tags from inside an iframe with Jquery -
i need select html5 video element inside embedded ifame (specifically video element generated embedding youtube video). know want use $("video") selector grab element, since in iframe more complex.
i found .contents() method spill out iframe contents (this link) however, request gets blocked because cross-origin request.
here dom error after trying .contents() method:
uncaught domexception: failed read 'contentdocument' property 'htmliframeelement': blocked frame origin "null" accessing cross-origin frame. @ error (native) @ m.each.contents (file:///home/alex/desktop/kiosk/client/jquery.js:2:26679) @ function.m.extend.map (file:///home/alex/desktop/kiosk/client/jquery.js:2:3714) @ m.each.m.fn.(anonymous function) [as contents] (file:///home/alex/desktop/kiosk/client/jquery.js:2:26777) @ <anonymous>:2:9 @ object.injectedscript._evaluateon (<anonymous>:905:140) @ object.injectedscript._evaluateandwrap (<anonymous>:838:34) @ object.injectedscript.evaluate (<anonymous>:694:21)
any ideas fix or work around this?
Comments
Post a Comment