3

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 Feb 29 '16 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); } – Thys Michels Mar 1 '16 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. – Thys Michels Mar 1 '16 at 17:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.