Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fails to load iframe from https source to http page #11197

Open
dhunkin opened this Issue Apr 3, 2013 · 4 comments

Comments

Projects
None yet
2 participants

dhunkin commented Apr 3, 2013

Code from test:

it('should test phantom iframe creation and receive message from iframe', function(done) {
  var ifrm = document.createElement('iframe');
  ifrm.setAttribute('src', 'https://dummy.net/channel.html');
  ifrm.style.visibility = 'hidden';
  var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
  var eventer = window[eventMethod];
  var messageEvent = eventMethod == "attachEvent" ? "onmessage" : "message";
  eventer(messageEvent, function(e) {
    done();
  }, false);
  document.body.appendChild(ifrm);
});

I run this code under karma test runner with Mocha test framework using Phantomjs as a browser to test in. This code can`t load the iframe from https source. channel.html should only do window.parent.postMessage('test', '*') on load. If I change it to load from http - it works great. However with dummy (fake domain) it crashes karma completely with http..

Collaborator

JamesMGreene commented Apr 3, 2013

  • Does this work in a normal browser?
  • What OS? Version?
  • What PhantomJS version? Compiled from source or download binaries?
Collaborator

JamesMGreene commented Apr 3, 2013

Also, did you launch PhantomJS with the command line option: --ignore-ssl-errors=true?

dhunkin commented Apr 3, 2013

It works with Chrome, Opera and Safari, and not with Firefox (all latest versions). Mac OS 10.8.2.
PhantomJS 1.9.0 - seems to be installed with brew (not compiled for sure).
No, I did not at the moment. I launch it with Karma test runner.

dhunkin commented Apr 16, 2013

Is there any news on this issue ? --ignore-ssl-errors=true option doesn`t help. What do you think, is it WebKit restriction or V8 ? May be I can help to fix this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment