Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

Disable PhantomJS Redirects #38

Open
RobLoach opened this issue Mar 23, 2015 · 5 comments
Open

Disable PhantomJS Redirects #38

RobLoach opened this issue Mar 23, 2015 · 5 comments

Comments

@RobLoach
Copy link
Contributor

Using something like the following will stall and error out PhantomJS, due to the URL redirect in the HTML.

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="refresh" content="1;url=http://example.com">
    <link rel="canonical" href="http://example.com">
    <script>
        window.location.replace('http://example.com');
    </script>
</head>
<body>
    <p>This page has been moved <a href="http://example.com">here</a>.</p>
</body>
</html>
@sindresorhus
Copy link
Contributor

It should follow the redirect, not disable it, right?

@samccone
Copy link

yeah seems like a default follow of the redirect would make sense since just like curl -L

@samccone
Copy link

alas
https://github.com/addyosmani/a11y/blob/master/index.js#L33

since we are execing the phantom binary it kinda limits our options here, imho it would be nice to use the npm wrapper to then be smart about following redirects.

thoughts?

@sindresorhus
Copy link
Contributor

@samccone I don't get what you mean as it's supposed to be implemented in the phantom script ariya/phantomjs#10389 (comment)

@samccone
Copy link

I see what you mean @sindresorhus it "should" work, I was just pointing out that we could be smart about it within phantom's onNavigationRequested and perhaps be smarter than the lib at handling cases like above. 🎱

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

3 participants