Skip to content

trouble with once #33

@skaplun

Description

@skaplun

Hey,
So i've been playing with this for two days, running into issues with once. The basic idea i'm trying to achieve is to detect a redirect on page load and exit out of the flow.
When i put once after open i get: TypeError: Cannot read property 'render' of null
When i put once at the end of the chain i get: TimeoutError: operation timed out

                 return pha
                        .viewport(1360, 960)
                        .open('http://' + link[0] + link[1])
                        .once('onLoadFinished', function(status) {
                            if(status === 301){
                                console.log('redirect')
                                reject();
                            }
                            resolve();

                        })
                        .screenshot(cleanSlashes + '.png')
                        .catch(function (e) {
                            console.log('error in scrapurl', e)
                        })
                        .finally(function () {
                            pha.exit();
                            console.log('finally! single url');

                        });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions