<tfoot id='m34Km'></tfoot>
<legend id='m34Km'><style id='m34Km'><dir id='m34Km'><q id='m34Km'></q></dir></style></legend>
  • <i id='m34Km'><tr id='m34Km'><dt id='m34Km'><q id='m34Km'><span id='m34Km'><b id='m34Km'><form id='m34Km'><ins id='m34Km'></ins><ul id='m34Km'></ul><sub id='m34Km'></sub></form><legend id='m34Km'></legend><bdo id='m34Km'><pre id='m34Km'><center id='m34Km'></center></pre></bdo></b><th id='m34Km'></th></span></q></dt></tr></i><div id='m34Km'><tfoot id='m34Km'></tfoot><dl id='m34Km'><fieldset id='m34Km'></fieldset></dl></div>

      <small id='m34Km'></small><noframes id='m34Km'>

          <bdo id='m34Km'></bdo><ul id='m34Km'></ul>

      1. 访问 UIWebView 的 JavaScriptCore 引擎

        时间:2023-10-22
        • <bdo id='21lmR'></bdo><ul id='21lmR'></ul>
          • <tfoot id='21lmR'></tfoot>
          • <small id='21lmR'></small><noframes id='21lmR'>

            <legend id='21lmR'><style id='21lmR'><dir id='21lmR'><q id='21lmR'></q></dir></style></legend>

                <i id='21lmR'><tr id='21lmR'><dt id='21lmR'><q id='21lmR'><span id='21lmR'><b id='21lmR'><form id='21lmR'><ins id='21lmR'></ins><ul id='21lmR'></ul><sub id='21lmR'></sub></form><legend id='21lmR'></legend><bdo id='21lmR'><pre id='21lmR'><center id='21lmR'></center></pre></bdo></b><th id='21lmR'></th></span></q></dt></tr></i><div id='21lmR'><tfoot id='21lmR'></tfoot><dl id='21lmR'><fieldset id='21lmR'></fieldset></dl></div>

                    <tbody id='21lmR'></tbody>
                1. 本文介绍了访问 UIWebView 的 JavaScriptCore 引擎的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我刚刚在 iOS7 中发现了一个可用的新框架:JavaScriptCore.

                  I just discovered a new framework available in iOS7: JavaScriptCore.

                  看起来很棒,但是我如何访问 UIWebView 的运行时/上下文?

                  It looks awesome, but how can I access the runtime/context of a UIWebView?

                  推荐答案

                  这个没有官方机制.但是我知道有两种方法可以获取 JSContext.我可能不会在运输应用中使用任何一种.

                  There is no official mechanism for this. But there are two approaches I know about to get the JSContext. I probably wouldn't use either in a shipping app.

                  1. 使用 KVC 访问内部 UIWebView 属性.在这篇博文中有详细解释:http://blog.impathic.com/post/64171814244/true-javascript-uiwebview-integration-in-ios7
                  1. Use KVC to access internal UIWebView properties. Explained in detail in this blog post: http://blog.impathic.com/post/64171814244/true-javascript-uiwebview-integration-in-ios7

                  JSContext *ctx = [webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
                  

                  1. 通过类别将魔术方法添加到NSObject.在这里进行更详细的解释:https://github.com/TomSwift/UIWebView-TS_JavaScriptContext
                  1. Add a magic method to NSObject via a category. Explained in more detail, here: https://github.com/TomSwift/UIWebView-TS_JavaScriptContext

                  @implementation NSObject (magic)
                  - (void) webView: (id) unused didCreateJavaScriptContext: (JSContext*) ctx forFrame: (id) frame
                  {
                      // ...
                  }
                  @end
                  

                  这篇关于访问 UIWebView 的 JavaScriptCore 引擎的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:允许 UIWebView 在没有 Internet 连接的情况下加载 http://localhost:port/pat 下一篇:iPhone 开发:在 UIWebView 上抓取选定/突出显示的文本

                  相关文章

                    <small id='Sd6vN'></small><noframes id='Sd6vN'>

                    <tfoot id='Sd6vN'></tfoot>
                    • <bdo id='Sd6vN'></bdo><ul id='Sd6vN'></ul>

                    <legend id='Sd6vN'><style id='Sd6vN'><dir id='Sd6vN'><q id='Sd6vN'></q></dir></style></legend>
                  1. <i id='Sd6vN'><tr id='Sd6vN'><dt id='Sd6vN'><q id='Sd6vN'><span id='Sd6vN'><b id='Sd6vN'><form id='Sd6vN'><ins id='Sd6vN'></ins><ul id='Sd6vN'></ul><sub id='Sd6vN'></sub></form><legend id='Sd6vN'></legend><bdo id='Sd6vN'><pre id='Sd6vN'><center id='Sd6vN'></center></pre></bdo></b><th id='Sd6vN'></th></span></q></dt></tr></i><div id='Sd6vN'><tfoot id='Sd6vN'></tfoot><dl id='Sd6vN'><fieldset id='Sd6vN'></fieldset></dl></div>