I'm tring to port an ionic2 application to Windows UWP.
This application scrapes some web pages and then extracts some information from them. In particular, I have necessity to display a web page inside an iframe and then extract a link inside a given HTML node.
In order to avoid CORS problem I added these lines in the config.xml file:
<access origin="*" />
<allow-navigation href="*" />
<allow-intent href="*" />
<allow-navigation href="http://*/*" />
<allow-navigation href="https://*/*" />
<allow-navigation href="data:*" />
This solution works well for both Android and iOS but not for Windows which, when I try to extract the page inside the iframe, raises a "denied access exception"
let documentPromise = new Promise(function(resolve,reject){
let el: any = document.getElementById('innerframetmp');
el.addEventListener('load', function(){
resolve(el.contentDocument); <-- "access denied exception here"
}, {once:true})
});
I tried also to add the CSP header in the index file with no luck. Is there any workaround for "Same Origin" security policy? Why the config.xml setting is not enough as it is for android and ios?
Thank you in advance.