Jump to content

PIXI.utils.isMobile not working


charlie_says
 Share

Recommended Posts

It seems that apple has changed their useragent so it doesn't say Ipad or the like.

I'm now finding it a bit hard to differentiate between devices.

I don't need super accurate, basically just ipad/iphone/android - is there another way of achieving this? (Alternatively, a fairly robust isDesktop would be fine.)

 

Link to comment
Share on other sites

Also - just to give some further detail about this issue.

What I needed to do was open a pdf in a new tab (window.open('path/to/my.pdf', '_blank');) which worked fine on desktop but failed on ios - which blocks it as a popup. In that case what I wanted to was just navigate to the pdf (window.location.href = 'path/to/my.pdf';) which works fine everywhere I tested so far.

My solution:

if ( !window.open('path/to/my.pdf', '_blank') ) {
                window.location.href = 'path/to/my.pdf';
            }
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...