浏览代码

Update webview manual post-WKWebView (#80)

WKWebView returns eval results as Foundation.framework primitives (NSNumber, NSString, etc), which serialise differently. As a result, JS `true` is returned as a `NSNumber` which serialises as `1`, when converted to a string.
Marius Petcu 5 年之前
父节点
当前提交
e5777358fc
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      docs/en/manuals/webview.md

+ 2 - 2
docs/en/manuals/webview.md

@@ -308,9 +308,9 @@ local function webview_callback(self, webview_id, request_id, type, data)
     if type == webview.CALLBACK_RESULT_EVAL_OK and
         request_id == self.closeCheckRequest then
 
-        -- Compare the JavaScript result, if it's "true" we should
+        -- Compare the JavaScript result, if it's "true" (or "1" on iOS) we should
         -- close the webview!
-        if data.result == "true" then
+        if data.result == "true" or data.result == "1" then
             webview.destroy(webview_id)
         end