Difference between allow-navigation and allow-intent

后端 未结 2 695
野趣味
野趣味 2021-02-18 23:09

Does any one know the difference between allow-navigation and allow-intent in cordova whitelist ?

相关标签:
2条回答
  • 2021-02-18 23:18

    per the documentation:

    allow-navigation

    Controls which URLs the WebView itself can be navigated to. Applies to top-level navigations only.

    allow-intent

    Controls which URLs the app is allowed to ask the system to open. By default, no external URLs are allowed.

    This whitelist worksheet should help.
    HOW TO apply the Cordova/Phonegap the whitelist system

    0 讨论(0)
  • 2021-02-18 23:41

    allow-navigation

    Controls which URLs the WebView itself can be navigated to. Applies to top-level navigations only.

    In other words, this affects links in your HTML/JS code, shown directly in the WebView (which is where your HTML5 app runs).

    allow-intent

    Controls which URLs the app is allowed to ask the system to open.

    This affects requests by native code (typically originating from Cordova plugins) to the native system (Different from a security standpoint, since these requests are not 'sandboxed' in the WebView).

    See here for details and types of configuration
    https://github.com/apache/cordova-plugin-whitelist/blob/master/README.md

    0 讨论(0)
提交回复
热议问题