Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if crosswalk webview?

I'm building a responsive website. When the user enters to the website through a browser such as Chrome, IE or Firefox, I want to show the links of play store and apple store. But if the user enters to the website through crosswal webview, I want to open the application.

It's possible? or it is bad idea?

Thank you.

like image 251
slorenzo Avatar asked Dec 15 '25 20:12

slorenzo


1 Answers

Can't say if it is a good or bad idea, but you can check for CrossWalk WebView using client's user agent:

if(navigator.userAgent.toLowerCase().indexOf('crosswalk') > -1) {
    // this is crosswalk view
} else {
    // this is NOT crosswalk view
}

Had the same question myself and saw yours. Found an answer and thought I'ld share it here as well.

like image 88
Uzbekjon Avatar answered Dec 17 '25 10:12

Uzbekjon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!