Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrating to 3.0.0 #1396

Closed
matthewmueller opened this issue Mar 2, 2018 · 0 comments
Closed

Migrating to 3.0.0 #1396

matthewmueller opened this issue Mar 2, 2018 · 0 comments

Comments

@matthewmueller
Copy link
Contributor

matthewmueller commented Mar 2, 2018

We've worked hard to limit the breaking changes for the 3.0.0 release. Here's the scenarios that broke along with their upgrade path:

"I'm using a custom preload script"

Before you could just reference window.__nightmare.ipc and nightmare would handle the rest. Now you'll need to copy and paste the whole preloader script in from lib/preload.js

"I'm using custom events inside a custom action"

These are no longer allowed since they've opened up security vulnerabilities in nightmare. There's probably a way to refactor your custom action that would avoid custom events. Please leave a note here if you've hit this and we'll try to accommodate you.

"I'm depending on the type of value that comes back from catch"

If you have something like this:

nightmare.goto('https://google.com').catch(function (e) {
   if (typeof e === 'string') {
      console.log('do something important')
   }
})

you'll need to change your code a bit. In nightmare 3.x all returned errors are actual Error values.

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

No branches or pull requests

1 participant