Safari 12 refuses to parse dataURLs
See original GitHub issueBug 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:
- Created 5 years ago
- Reactions:10
- Comments:12 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.super, thank you!