Currenlty私はコードサイトアプリ内でオンラインサイトに埋め込みます。私のconfig.xmlには以下の通りです:iframeにcordovaコマンドを実行させる
<plugin name="cordova-plugin-whitelist" spec="1" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<allow-navigation href="*" />
と私のindex.htmlは、次のメタタグを持っている:
<meta http-equiv="Content-Security-Policy" content="default-src *;
style-src * 'self' 'unsafe-inline' 'unsafe-eval';
script-src * 'self' 'unsafe-inline' 'unsafe-eval';">
は、今私は、内側のサイトから(アプリの)codovaコマンドを実行する必要があります、私は次のコードを使用しています:
window.parent.cordova.plugins.barcodeScanner.scan(function (result) {},
function (error) {});
を、それは(正しく)で失敗しています:
Uncaught SecurityError: Blocked a frame with origin "http://" from accessing a frame with origin "file://". The frame requesting access has a protocol of "http", the frame being accessed has a protocol of "file". Protocols must match.
このような種類の外部サイトからアプリケーションへの対話を許可するにはどうすればよいですか?