Can you detect if your web page is running inside your Windows Mobile native App?

143 views Asked by At

How can you check that a web page is being served under a native app on Windows phone?

You cant use custom user agents, so to date we have done the following...

Check the user agent for Windows Phone, check it for WebBrowser which indicates its served from the WebBrowser windows control, and then try to call a method in our native app to guarantee we are in our app.

However, the latest browser updates to windows have removed WebBrowser from the user agent.

This means there would be delay when viewing the page on Mobile IE, as we would have to try to talk to our native app to see if it's there or not, and wait for a timeout to assume its not there.

So..

1) Is there anyway now to set custom user agents in windows Mobile - everything we have tried to date has failed.

2) Is there another way we can indicate to the page that its running in our app? Inject some JS at the start some how?

3) Any other way to somehow tell the web page what its running in? Cookies, local storage?

We need to know where its running before it has finished loading, so JS scripts can tell where they are running as they load up.

m

0

There are 0 answers