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

DevTools not detecting then mobile mode enabled #35

Open
smskin opened this issue Apr 17, 2019 · 2 comments
Open

DevTools not detecting then mobile mode enabled #35

smskin opened this issue Apr 17, 2019 · 2 comments
Labels
bug 💵 Funded on Issuehunt This issue has been funded on Issuehunt help wanted

Comments

@smskin
Copy link

smskin commented Apr 17, 2019

Issuehunt badges

Does not determine the state of devtools when mobile view is enabled.
image


IssueHunt Summary

Backers (Total: $60.00)

Submitted pull Requests


Become a backer now!

Or submit a pull request to get the deposits!

Tips

@issuehunt-oss issuehunt-oss bot added the 💵 Funded on Issuehunt This issue has been funded on Issuehunt label May 2, 2019
@IssueHuntBot
Copy link

@IssueHunt has funded $60.00 to this issue.


@kevgathuku
Copy link

kevgathuku commented May 6, 2019

Hi @smskin @sindresorhus I've been looking into this issue and it seems that when the mobile view is enabled, the window.outerWidth and window.innerWidth are always equal. The same is happening for window.innerHeight and window.outerHeight which are always equal.
i.e. the widthThreshold and heightThreshold are always false
https://github.com/sindresorhus/devtools-detect/blob/master/index.js#L28-L29
This seems to be why the current implementation does not work.

UPDATE:
I found this solution
https://gist.github.com/kevgathuku/b6fcc0bf1d5e478f4ed6876b0cc01c0c
It works perfectly in Chrome but unfortunately doesn't work in Firefox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 💵 Funded on Issuehunt This issue has been funded on Issuehunt help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants