Detect Which Application (Web, Mobile or Touch Browser) is Loading Web Page?

If you look at the image, there are shared web pages between the 3 applications, Web, Mobile and Touch Browser. I need to report the web pages uniquely per application. So if web page A is loaded, it will need to load different JS libraries for each type of application. Currently a JS bootstrap loader file handles the logic to load the proper JS libraries but that is a 1-to-1 relationship. I now need a way to determine which application is loading the web page and load the appropriate libraries (DTM libraries but irrelevant). The solution would have to reside in the JS bootstrap loader file logic. I’m looking into using the navigator object to sniff out which type of application is requesting the web page but not sure how feasible that is? Maybe feature detection is another way but not sure how/if this would work with the applications? Any ideas?

Web Page/Application Distribution
894359Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

leakim971PluritechnicianCommented:
a similar question here, where you can fine client and server side implementation. If you already did it client side, just check the server side solution to do the same job.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
894359Author Commented:
Hi Leakim971, not sure  what you mean but server-side is not an option?
0
894359Author Commented:
Is there a way an application can set a variable that JS on a web page can read?
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

894359Author Commented:
I think location.protocol will be helpful for mobile apps but having issues getting much if any info for Touch Broswer.
0
Chinmay PatelChief Technical NinjaCommented:
I am not sure if this is what you are looking for, but have you tried using :

https://github.com/lancedikson/bowser

Another way which is a bit of a hack is you could use Modernizer to detect capabilities and then determine which files to serve.

Regards,
Chinmay.
0
894359Author Commented:
Thanks Chinmay... I did read an article touching on this. It was old though.   http://www.stucox.com/blog/you-cant-detect-a-touchscreen/
1
Chinmay PatelChief Technical NinjaCommented:
Very interesting read 894359. I stumbled upon some other blogs as well after reading the one you have suggested.
So how about using a combination of both? Maybe try to use Bowser first and to be extra sure call Modernizer?
0
leakim971PluritechnicianCommented:
sorry I thought I posted a link... strange...
here the link I tried to provide on my first answer :
https://www.experts-exchange.com/questions/26728131/I-would-like-to-detect-mobile-device.html
0
894359Author Commented:
Thank you all for the info!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.