marcuswestin / WebViewJavascriptBridge

An iOS/OSX bridge for sending messages between Obj-C and JavaScript in UIWebViews/WebViews
http://marcuswest.in
MIT License
14.29k stars 2.98k forks source link

Why don't work in iPad Air (14.1) ? #419

Open boyXiong opened 3 years ago

boyXiong commented 3 years ago

WVJB Bug Report

Thanks for reporting an issue with WebViewJavascriptBridge.

Do these 4 things and I will fix your problem!

  1. Go to https://github.com/marcuswestin/WebViewJavascriptBridge and click Fork.
  2. Clone your fork, cd into it and run make test. All tests should pass!
  3. Edit Tests/WebViewJavascriptBridgeTests/BridgeTests.m and create a new, failing test which demostrates your issue.
  4. Create a pull request for https://github.com/marcuswestin/WebViewJavascriptBridge

That's it!

I will take it from there and promise that I'll fix your problem ASAP.

If you don't do this then I can't help you!

And I probably won't :)

Cheers, @marcuswestin

BoxDengJZ commented 2 years ago

https://github.com/marcuswestin/WebViewJavascriptBridge/issues/383

BoxDengJZ commented 2 years ago

        let configuration = WKWebViewConfiguration()
        configuration.preferences.javaScriptEnabled = true
        if #available(iOS 13.0, *) {
            configuration.defaultWebpagePreferences.preferredContentMode = .mobile
        }

        let w = WKWebView(frame: .zero, configuration: configuration)