LonestarX91 commented on pull request #358:
URL:
https://github.com/apache/cordova-plugin-file/pull/358#issuecomment-750203096
> @LonestarX91 Have you tired using this ionic plugin
"cordova-plugin-ionic-webview". I've modified the url to match plugin
recommendation.
>
> url = "ionic://localhost/cordova.js";
> var el = document.createElement('script');
> el.id = "123";
> el.onerror = function () {
> if (el.onerror) show_error("Cordova js not found")
> }
> el.onload = function () {}
> el.src = url;
> document.body.appendChild(el);
>
> Can you give try once?
changed everything in prefs (scheme), allow-intent, etc to ionic, changed
CSP on the server to
```
<meta http-equiv="Content-Security-Policy" content="
default-src * ionic: cdvfile: cdvfile://* data:
blob: gap://ready file://*;
style-src * 'unsafe-inline';
script-src * ionic: ionic://* file://* cdvfile:
cdvfile://* cdvfile://localhost/* 'unsafe-inline' 'unsafe-eval';">
```
changed my loading code to
```
var url = "ionic://localhost/" + localFolder + "/www/cordova.js";
var el = document.createElement('script');
el.id = "cordova";
el.type = "text/javascript";
el.onerror = function () {
console.error('error loading cordova script')
}
el.onload = function () {
}
el.src = url;
document.body.appendChild(el);
```
aaaaand i get....
`Refused to load ionic://localhost/bundle/www/cordova.js because it does not
appear in the script-src directive of the Content Security Policy.`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]