You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ni...@apache.org on 2021/07/14 06:13:29 UTC

[cordova-android] branch webviewassetloader-allowlist created (now b75bc89)

This is an automated email from the ASF dual-hosted git repository.

niklasmerz pushed a change to branch webviewassetloader-allowlist
in repository https://gitbox.apache.org/repos/asf/cordova-android.git.


      at b75bc89  fix: add WebViewAssetloader to default allow list

This branch includes the following new commits:

     new b75bc89  fix: add WebViewAssetloader to default allow list

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[cordova-android] 01/01: fix: add WebViewAssetloader to default allow list

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

niklasmerz pushed a commit to branch webviewassetloader-allowlist
in repository https://gitbox.apache.org/repos/asf/cordova-android.git

commit b75bc895a14ae861e9d444bd8fe6ea69e93401c2
Author: Niklas Merz <nm...@gedys-intraware.de>
AuthorDate: Wed Jul 14 08:12:30 2021 +0200

    fix: add WebViewAssetloader to default allow list
    
    Fixes #1217
---
 framework/src/org/apache/cordova/AllowListPlugin.java | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/framework/src/org/apache/cordova/AllowListPlugin.java b/framework/src/org/apache/cordova/AllowListPlugin.java
index 7b2e787..ccb0e79 100644
--- a/framework/src/org/apache/cordova/AllowListPlugin.java
+++ b/framework/src/org/apache/cordova/AllowListPlugin.java
@@ -23,6 +23,7 @@ import org.apache.cordova.CordovaPlugin;
 import org.apache.cordova.ConfigXmlParser;
 import org.apache.cordova.LOG;
 import org.apache.cordova.AllowList;
+import org.apache.cordova.CordovaPreferences;
 import org.xmlpull.v1.XmlPullParser;
 
 import android.content.Context;
@@ -73,12 +74,17 @@ public class AllowListPlugin extends CordovaPlugin {
     }
 
     private class CustomConfigXmlParser extends ConfigXmlParser {
+        private CordovaPreferences prefs = new CordovaPreferences();
+
         @Override
         public void handleStartTag(XmlPullParser xml) {
             String strNode = xml.getName();
             if (strNode.equals("content")) {
                 String startPage = xml.getAttributeValue(null, "src");
                 allowedNavigations.addAllowListEntry(startPage, false);
+
+                // Allow origin for WebViewAssetLoader
+                allowedNavigations.addAllowListEntry("https://" + this.prefs.getString("hostname", "localhost") + "/" + startPage, false);
             } else if (strNode.equals("allow-navigation")) {
                 String origin = xml.getAttributeValue(null, "href");
                 if ("*".equals(origin)) {

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org