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

.goto() returns null if the page was redirected #78

Open
gen6033 opened this issue Oct 9, 2017 · 3 comments
Open

.goto() returns null if the page was redirected #78

gen6033 opened this issue Oct 9, 2017 · 3 comments

Comments

@gen6033
Copy link

gen6033 commented Oct 9, 2017

I tried to get .goto() response as follows, but second one that including redirection didn't work as expected.

async function f(){
    chromy = new Chromy({visible:true});
    response = await chromy.goto("https://www.google.co.jp/");
    console.log(response); // response object

    response = await chromy.goto("http://bit.ly/1awXseo");
    console.log(response); // null
}
f();

I think this line is bad. Since payload.response.url is the redirected URL, the condition will never be true.
https://github.com/OnetapInc/chromy/blob/for-chrome61/src/index.js#L257

@gen6033
Copy link
Author

gen6033 commented Oct 9, 2017

I found more simple example.

async function f(){
    chromy = new Chromy({visible:true});
    response = await chromy.goto("https://www.google.co.jp/");
    console.log(response); // response object

    response = await chromy.goto("https://www.google.co.jp"); // no last slash
    console.log(response); // null
}
f();

So this issue is unrelated to redirection.

dotneet added a commit that referenced this issue Oct 11, 2017
@dotneet
Copy link
Contributor

dotneet commented Oct 11, 2017

Hi @gen6033,
Thank you for reporting this issue.
I've resolved two problems related to this issue.
If you have a time, please test latest for-chrome61 branch.

@gen6033
Copy link
Author

gen6033 commented Oct 30, 2017

Thank you @dotneet , and sorry for my late reply.
The issue related to malformed URL was fixed!
But first one (related to redirection) does not still work.

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

No branches or pull requests

2 participants