Add inline iframe management to your Nightmare scripts.
Original idea was thanks to @tiangolo in segmentio/nightmare#496.
This plugin overrides Nightmare's internal
evaluate_now method to wrap the page's
document variable. This is dangerous and fragile. After entering an iframe, certain functionality may not work as expected. Read the pull in the credit link for more information. You have been warned.
Require the library, passing the Nightmare constructor as a parameter:
var Nightmare = ;Nightmare;
... and that's it. You should now be able to enter and exit iframes.
Enter an iframe with the given selector. All subsequent requests will go through that iframe until
.resetFrame() is called.
Exits the current selector to the previous one. If exiting the last selector, this exits to the root document.
Resets all frames and restores the root document.
var Nightmare = ;Nightmare;var nightmare = ;nightmaretitle
Blocked iFrame Cross-Origin Communication
var nightmare =
When webSecurity is set to false, it will disable the same-origin policy (usually using testing websites by people), and set allowDisplayingInsecureContent and allowRunningInsecureContent to true if these two options are not set by user. Default is true.