除了在其框架内执行之外,iOS 上的 javascript 是否必须*由* WebKit 框架下载? [英] Does javascript on iOS have to be downloaded *by* the WebKit framework in addition to executing within its framework?

查看:15
本文介绍了除了在其框架内执行之外,iOS 上的 javascript 是否必须*由* WebKit 框架下载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

协议是这样说的:

3.3.2 内部使用应用程序不得下载或安装可执行代码.如果所有脚本、代码和解释器都打包在应用程序中而不是下载,则解释代码只能在应用程序中使用.唯一的例外是由 Apple 的内置 WebKit 框架下载和运行的脚本和代码.

3.3.2 An Internal Use Application may not download or install executable code. Interpreted code may only be used in an Application if all scripts, code and interpreters are packaged in the Application and not downloaded. The only exception to the foregoing is scripts and code downloaded and run by Apple's built-in WebKit framework.

它特别写着.. 代码下载 .. 由 Webkit 框架".

It particular it says ".. code downloaded .. by Webkit framework".

是否有人知道对于使用 UIWebView 的本机应用程序,这是否意味着 Webkit 必须自动下载 Javascript,即作为用户单击外部 URL 链接的结果.或者,是否可以通过创建我自己的 HTTP 连接到服务器并自己下载来下载脚本 - 但它们将在 Webkit 中执行(通过 UIWebView)?

Does anybody know if for a native app using UIWebView this means Javascript has to be downloaded automatically by Webkit i.e. as a consequence of the user clicking on an external url link. Or if it would be acceptable for the scripts to be downloaded by creating my own HTTP connection to a server and downloading them myself - but they would be executed within Webkit (via UIWebView) ?

我认为这个限制是出于安全目的,那么安全性是否来自将执行限制在 WebKit 内,而不是从哪里下载脚本?

I presume this restriction is for security purposes, so does the security come from limiting the execution to within WebKit, as opposed to where the scripts are downloaded from?

我意识到除了 Apple 之外,几乎没有人能明确回答这个问题,但非常欢迎推测性的答案.

I realize its unlikely anybody can definitively answer this except Apple, but speculate answers are very welcome.

谢谢

推荐答案

Apple 的例外是基于 Webkit/UIWebView 的沙盒特性——实际上,它提供了一个允许的"脚本化环境,正是因为它是如此很好的沙箱.如果您提供 UIWebView,那么如果用户导航到一个站点,然后在浏览器中执行一些 Javascript,与您通过 NSURLConnection 或其他方式以编程方式获取一些 Javascript,然后将其加载到 UIWebView 中,则没有任何实际区别重新加载 HTML 文件或使用stringByEvaluatingJavaScriptFromString".

The exception that Apple is making is based upon the sandboxed nature of Webkit/UIWebView - in effect, it provides an "allowed" scriptable environment precisely because it is so well sandboxed. If you provide a UIWebView, it doesn't make any real difference if the user navigates to a site that then executes some Javascript in the browser, versus you programmatically getting some Javascript via NSURLConnection or other way, and then loading that into the UIWebView be reloading an HTML file or using "stringByEvaluatingJavaScriptFromString".

这篇关于除了在其框架内执行之外,iOS 上的 javascript 是否必须*由* WebKit 框架下载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆