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

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

问题描述

该协议这样说:

3.3.2内部使用应用程序可能无法下载或安装可执行code。国米preTED code可能只在一个应用程序中使用,如果所有的脚本,code和跨preters被打包在应用程序,而不是下载。唯一的例外前述的脚本和code下载并运行苹果的内置的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.

这尤其它说:.. code下载..通过Webkit的框架。

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

有谁知道,如果使用UIWebView的本机应用程序,这意味着使用Javascript必须由Webkit内核,即自动下载的用户点击的外部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) ?

我presume此限制是出于安全的目的,所以没有安全来自限制执行到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?

我意识到它不可能有人能明确地回答这个问题,除了苹果,但推测答案是非常欢迎的。

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

感谢

推荐答案

例外,苹果正在基于Webkit内核的沙盒自然/ UIWebView的 - 实际上,它pcisely因为提供了允许脚本化的环境$ P $它是这么好沙盒。如果您提供一个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天全站免登陆