Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Safari 12 refuses to parse dataURLs #4964

Open
chrisguttandin opened this issue Sep 23, 2018 · 12 comments
Open

Safari 12 refuses to parse dataURLs #4964

chrisguttandin opened this issue Sep 23, 2018 · 12 comments

Comments

@chrisguttandin
Copy link

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.

@sbrez
Copy link

sbrez commented Nov 19, 2018

Any news on this issue?

@EberhardSchneider
Copy link

Same here. Anything new?

@nayanr9
Copy link

nayanr9 commented Feb 1, 2019

Any update or fix for this issue ??

@nayanr9
Copy link

nayanr9 commented Feb 1, 2019

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.

Do you have any update for this? My suite is not running on Safari
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:13:22.693Z'
System info: host: 'INC02Q40GKG8WP', ip: 'fe80:0:0:0:c94:4b60:1b53:e9fb%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14', java.version: '1.8.0_172'
Driver info: driver.version: unknown

Tried the example given in https://github.com/angular/protractor/blob/master/docs/browser-setup.md website, that as well is giving the same error. I think it has something to do with the driver.

@prasadqc
Copy link

Facing same issue, Any fix for this issue?

@Nagadinesh
Copy link

Any fix for this issue? What is the alternative anyone is trying right now?

@evilaliv3
Copy link
Contributor

We are now encountering the same issue in the @globaleaks project: https://api.travis-ci.org/v3/job/582019060/log.txt

@chrisguttandin have you found any solution?

@juliemr @cnishina do you have any advice?

@evilaliv3
Copy link
Contributor

@chrisguttandin: is it possible that the app you were testing was implementing Content Security Policy headers preventing data URIs?

@evilaliv3
Copy link
Contributor

Actually this comment by @juliemr seems relevant: #1223 (comment)

@nayanr9
Copy link

nayanr9 commented Sep 7, 2019

#4964 (comment)
Yes we have csp enabled in our app.

@chrisguttandin
Copy link
Author

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.

@evilaliv3
Copy link
Contributor

super, thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants