如何使网站只能在UIWebView上查看,而不能在其他任何地方查看


How can I make a website only viewable on a UIWebView and not anywhere else?

所以我的应用程序中有一个UIWebView,可以加载我创建的网站。所以它加载的是网络文件而不是本地文件。

如何使此网站不能在任何iPhone互联网浏览器上查看,但可以在我的UIWebView上查看。

获取浏览器deatils的代码。。。

<?php
echo $_SERVER['HTTP_USER_AGENT'] . "'n'n";
$browser = get_browser(null, true);
print_r($browser);
?>

尝试检查uiwebview,其他iOS浏览器,而不是iOS浏览器,

  <div id="where-am-i"></div>
    <script>
        var standalone = window.navigator.standalone,
            userAgent = window.navigator.userAgent.toLowerCase(),
            safari = /safari/.test( userAgent ),
            ios = /iphone|ipod|ipad/.test( userAgent );
        if( ios ) {
            if ( !standalone && safari ) {
                document.getElementById( 'where-am-i' ).textContent = 'browser';
            } else if ( standalone && !safari ) {
                document.getElementById( 'where-am-i' ).textContent = 'standalone';
            } else if ( !standalone && !safari ) {
                document.getElementById( 'where-am-i' ).textContent = 'uiwebview';
            };
    </script>