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

Struggeling width document with #556

Open
matthiastosch opened this issue Sep 23, 2015 · 4 comments
Open

Struggeling width document with #556

matthiastosch opened this issue Sep 23, 2015 · 4 comments
Labels
Milestone

Comments

@matthiastosch
Copy link

Hi There,

i'm trying to detect if the tested url is a mobile site. One Metrik i try to use is document width is greater than the viewport width (in --phone mode) than i would like to store the metric isMobile = 0.

My Problem is: all js attributes for the document with are the same as the viewport size (400 in phone mode)
document.body.scrollWidth
document.documentElement.scrollWidth

when i try this in mobile emulator on chrome with the url www.mtosch.de i got the result 980. With phantomas i got alway 400. Is there a difference with the emulation?

Or do you know an other way to detect mobile Markup?

Thanks a lot for help
Matthias

@macbre
Copy link
Owner

macbre commented Sep 23, 2015

@matthiastosch, I assume you're using the latest version of phantomas. If so, please try running phantomas using PhantomJS 2.0 (--engine=webkit2).

@matthiastosch
Copy link
Author

with --engine=webkit2 i got this error.
phantomas https://www.mtosch.de/ --engine=webkit2 --verbose
phantomas: (255) Engine crashed unexpectedly

i use mac os.

@matthiastosch
Copy link
Author

i've run the the script with Debian & --engine=webkit2 and all values are 400. As described in my first post on top.
is this a bug or does phantomas dosn't support this?

do you have an other idea to detect mobile friendly markup?

@macbre
Copy link
Owner

macbre commented Sep 25, 2015

Well, phantomas is not responsible for running "browser" JavaScript - it's PhantomJS that gives you incorrect values.

You can give SlimerJS a try - --engine=gecko.

@macbre macbre modified the milestone: Roadmap Oct 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants