Incuding cordova.js in my visualforce page

<apex:includeScript value="{!URLFOR($Resource.BPMobile, 'BPMobile/cordova/cordova.js')}" />

Getting the following in chrome console:

Mixed Content: The page at 'https://bpsbox-bp.cs10.force.com/BPMobile/BP_Community_Intro' was loaded over HTTPS, but requested an insecure resource 'gap://ready'. This content should also be served over HTTPS.

there is no cdn to load cordova.js over https://

also just including cordova like this does not work when running on iphone

<script type="text/javascript" charset="utf-8" src="cordova.js"></script> 

any suggestions?

  • 2
    It looks like it's loading cordova.js ok, but then cordova is trying to load gap://ready, which is causing it to throw the Mixed Content error. Not sure what the answer is, but I'll ping a couple of people.
    – metadaddy
    Commented Feb 29, 2016 at 21:37
  • Here is the snippet that seems to cause the problem: // Check if they've removed it from the DOM, and put it back if so. if (execIframe && execIframe.contentWindow) { execIframe.contentWindow.location = 'gap://ready'; } else { execIframe = document.createElement('iframe'); execIframe.style.display = 'none'; execIframe.src = 'gap://ready'; document.body.appendChild(execIframe); } Commented Mar 1, 2016 at 17:52
  • Seems like it is trying to create a iframe element. Saw that the sample app adds the follow Content-security-policy meta tag: <meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *"> added it to my visualforce page but getting error, seems like it is not allowed. Commented Mar 1, 2016 at 17:55


You must log in to answer this question.

Browse other questions tagged .