i want to search a simple string like <div class="sender" style="display: block;">
in iframe
on a external website.
The code don't work
var target = '<div class="sender" style="display: block;">'
console.log( $( "iframe" ).contents().find('body').html().search( target ) != -1 )
because i have an error
Uncaught SecurityError: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame with origin "http://website1.com" from accessing a frame with origin "http://website2.com". Protocols, domains, and ports must match.
How can I do please?