How can I gently ruin a UIWebview?

Recently, several developers have begun to create applications that no more than point to state content (free, public property) through UIWebViews. This is usually not a problem, except that applications support all ads, and some are even paid. In fact, they earn on state content.

My question is this: how can I get a site to open a new Safari window, rather than displaying it in UIWebview (which is wrapped in app branding)? I can detect UIWebview using the following, but I can do nothing but just hide the content. I would prefer it to provide a link to our content, which then opens in Safari.

This is how I discover UIWebview:

var is_uiwebview = /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent); 
+4
source share
3 answers

unfortunately, it’s quite difficult for the developer to force the User-Agent string whatever they want, so your attempts to prevent these developers may be temporary. You cannot force your content to be viewed in a browser. The user can use a tool, such as CURL, to view your content ...

+2
source

Once you find yourself in UIWebview, you need to run window.open () to put your content in a new window.

This suggests some quirks that make it a bit complicated (but not impossible): Opening pop-up links in UIWebview . Please note that the question is the opposite of you, but the accepted answer shows how to make UIWebview appear in a new window through Javascript.

This has become a problem from the very beginning of the Network. You cannot stop people from scraping your content, but you can make it harder to rephrase it.

Edited to add

Unfortunately, for you, the application may intercept window.open (): UIWebView answers Javascript calls

I assume that you can always refuse and show a banner that says something like "you paid for this data with your taxes, you should not pay for it again with advertising. Just open a browser and go to ..."

+1
source

You can find out if it is WebView or Mobile Safari, as shown in this thread . The problem is that you can only open Safari using a custom URL scheme, but think that only http: //, https: // etc. works. Even if there was something like safari-http: //, application programmers with UIWebView could catch this request and redirect it back to the web view. So, I'm sorry to say: This is impossible.

+1
source

All Articles