isSecureContext method

Future<bool> isSecureContext()

Indicates whether the webpage context is capable of using features that require secure contexts.

Officially Supported Platforms/Implementations:

  • Android WebView 21+:
    • This method is implemented using JavaScript.
  • iOS WKWebView:
    • This method is implemented using JavaScript.
  • Linux WPE WebKit:
    • This method is implemented using JavaScript.
  • macOS WKWebView:
    • This method is implemented using JavaScript.
  • Web <iframe> but requires same origin (Official API - Window.isSecureContext)
  • Windows WebView2:
    • This method is implemented using JavaScript.

Use the PlatformInAppWebViewController.isMethodSupported method to check if this method is supported at runtime.

Implementation

Future<bool> isSecureContext() => platform.isSecureContext();