Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在 iOS14.x 版本中出现了 localstorage 不同步的问题 #85

Open
DarrenKong opened this issue Nov 27, 2023 · 0 comments
Open

在 iOS14.x 版本中出现了 localstorage 不同步的问题 #85

DarrenKong opened this issue Nov 27, 2023 · 0 comments

Comments

@DarrenKong
Copy link

在 iOS14.x 版本中出现了这个问题。

我们在 App 中,从一个 Webview 中打开了另一个 Webview,然后在第二个 Webview 中对 localstorage 进行了修改,但是关闭第二个 Webview 返回到第一个Webview,没有读取到改变之后的内容,还是原来的值。

后来调整了 KKJSBridge 源码中,关于 WKProcessPool 相关代码的位置,问题得以解决。
将如下代码从 KKWebView 移到 WebViewController 中,同时将 processPool 的引用移到 makeWebViewConfiguration 中。

+ (WKProcessPool *)processPool {
    static WKProcessPool *pool;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        pool = [[WKProcessPool alloc] init];
    });
    
    return pool;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant