question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Safari 12 refuses to parse dataURLs

See original GitHub issue

Bug report

  • Node Version: v10.11.0
  • Protractor Version: 5.4.1
  • Angular Version: 6.1.8
  • Browser(s): Safari 12
  • Operating System and Version macOS 10.13.6
  • Your protractor configuration file

The configuration file is the same as the one which was generated by the CLI. Only the browserName was changed and the directConnect property was removed.

  // ... as provided by @angular/cli
  capabilities: {
    'browserName': 'safari'
  },
  // remove the directConnect property
  // ...
  • A relevant example test

It’s enough to just run the default tests.

ng e2e
  • Output from running the test
should display welcome message
      - Failed: Could not parse requested URL 'data:text/html,<html></html>'
  • Steps to reproduce the bug
npx --package @angular/cli ng new safari-test
cd safari-test
# Change the browserName in the config to 'safari' and remove the directConnect property.
ng e2e

A workaround is to add browser.resetUrl = 'about:blank'; to the onPrepare function. But I think it would be nice if Protractor works with Safari out of the box. A fix for Safari which does at least not break tests with Chrome would be to change the DEFAULT_RESET_URL to ‘about:blank’. But I don’t know if that has implications which affect other browsers.

https://github.com/angular/protractor/blob/master/lib/browser.ts#L22

Please let me know if you think it is a viable solution. I’m happy to provide a pull request for changing that.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:10
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
chrisguttandincommented, Sep 7, 2019

Hi @evilaliv3, no I don’t use CSP when running the tests.

As mentioned in the bug report above a workaround is to add browser.resetUrl = 'about:blank'; to the onPrepare function as done for example here.

0reactions
evilaliv3commented, Sep 7, 2019

super, thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix: Cannot Parse Response in Safari Browser?
Check DNS and Use Google DNS. Having the “Cannot parse response error” in the Safari browser is very unlikely due to DNS issues...
Read more >
Cannot parse response - Apple Community
Hello Apple-Communities,. I've the problem when I try to access a site with any iOS device I got the error message: cannot parse...
Read more >
JSON.parse Fails in Safari when a string value contains a ...
The problem is basically that you're storing data into the cookie string but not escaping it. So when you set the cookie and...
Read more >
Fix “Safari Can't Open Page” Error on iPhone, iPad, Mac
The next thing you want to do is check the website URL address, so that you know it is correct and proper. This...
Read more >
Unable to parse Build/HTML5.framework.js.gz! - Need Help...
Resolved Unable to parse Build/HTML5.framework.js.gz! ... IIS URL rewrite also says the XML isnt well formed, the code in the docs is trash....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found