WhiteList plugin has stopped working!!

57 views
Skip to first unread message

SB

unread,
Jan 8, 2016, 11:39:22 AM1/8/16
to phonegap
In android app developed using cordova/phonegap cli I have an Iframe that loads external site. The app was working fine and suddenly it stopped loading the site in the Iframe.
I am using cordova version 5.2.0.,
App is build using cordova cli for android and IOS.  I has stopped loading in both environments.

code in config.xml is
<code>

?xml version='1.0' encoding='utf-8'?>
<widget id="io.cordova.hellocordova" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>HelloCordova</name>
    <description>
        A sample Apache Cordova application that responds to the deviceready event.
    </description>
    <author email="" href="http://cordova.io">
        Apache Cordova Team
    </author>
    <content src="index.html" />
    <plugin name="cordova-plugin-whitelist" source="npm"  />
    <allow-navigation href="*" />
    <allow-intent href="*" />
    <access origin="*" /> <!-- Required for iOS9 -->
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <allow-navigation href="*" />
    <platform name="android">
        <allow-intent href="market:*" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
    </platform>
</widget>
</code>

code in index.html is
<code>
<!DOCTYPE html>
<html>
    <head>
 <meta http-equiv="Content-Security-Policy"  content="default-src *;  style-src * 'self' 'unsafe-inline' 'unsafe-eval';  script-src * 'self' 'unsafe-inline' 'unsafe-eval';">
        <meta name="format-detection" content="telephone=no">
        <meta name="msapplication-tap-highlight" content="no">
        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
        <link rel="stylesheet" type="text/css" href="css/main.css">
        <script type="text/javascript" src="cordova.js"></script>
        <script type="text/javascript" src="js/main.js"></script>
        <title>Hello World</title>
        <style>
            iframe {height: 50%; padding: 0; margin: 0; width: 50%}
        </style>
    </head>
    <body>
        <div>
             <h1>Begin</h1>       
             <iframe id="main"  src="https://google.com"/>
             <h1>End</h1>
        </div>     
    </body>
</html>

</code>

Thanks
SB

mayor

unread,
Jan 8, 2016, 12:13:47 PM1/8/16
to phonegap
Content Security Policy will post a detailed json object to a uri.  just add a "report-uri" like so:

http-equiv="Content-Security-Policy"  content="default-src *; report-uri https://wherever.com/error-catcher;"

Jesse Monroy

unread,
Jan 10, 2016, 6:33:23 PM1/10/16
to phonegap
@SB,
You say it stopped working!!

When was the iframe working? What iframe ever working? If so, what did you change?

Jesse
Reply all
Reply to author
Forward
0 new messages