You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 24, 2018. It is now read-only.
Hi there,
I am on a team that is trying to test a website that includes an iframe to a third-party component hosted on a different server. We need to be able to detect DOM events on document elements inside this iframe but I am running into the following error:
(node:17244) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: DOMException: Failed to read the 'contentDocument' property from 'HTMLIFrameElement': Blocked a frame
with origin "https://oursite.com" from accessing a cross-origin frame.
Is there a way to disable the same origin security policy in the automatically launched instance of Chrome started by Chromeless? Or would it be best just to start a local instance of Chrome with the --disable-web-security ?
Additional Details:
Our code looks as follows (hosts/urls changed):
async function run() {
const chromeless = new Chromeless()
var extIframePresent = await chromeless.goto('https://oursite.com/ourpage')
.wait(4000)
.evaluate(()=>{
var extIframe = document.getElementsByClassName('container-with-3rd-party-iframe')[0].getElementsByTagName('iframe')[0];
extIframe = extIframe.contentDocument || extIframe.contentWindow.document;
extIframe = extIframe.contentDocument;
return extIframe;
});
console.log('extIframePresent = ', extIframePresent);
}
run()
Activity
bubakazouba commentedon Jun 18, 2018
+1