Automatically prefix http on iOS?

I’m calling an external javascript file that I can’t control or download (as it changes and needs to stay on the server). It calls some resources with the (//:(url)) as opposed to the (http://). It is not maintained by me and I can not fix it. When ever I run my app inside of iOS it fails to load that component because of that error. Is there any plugin to fix that?

A cordova hook would be the best solution. You could adapt this to fit your needs.

Particularly the second one

That is a great blog post, and I can see how Hooks would be beneficial when building a project.

But my question (and the OPs question I think) is to do with during runtime. I personally am having a major issue with Facebook authentication via Firebase in Ionic. I am getting ‘transport errors’ when trying to use authWithOAuthRedirect() because I think the redirect prefix does not have ‘http://’. It works fine in the browser, just not on iOS.

If you need to change things on the fly, you can always setup some logic to change the path depending on the platform

var fileUrl;
var isIOS = ionic.Platform.isIOS();
// Will return true if on iOS

if (isIOS){
// Load data using 'http://'
fileUrl = ''
} else {
// Load data using ' //'
fileUrl = '//'