Skip to content
This repository has been archived by the owner on Feb 25, 2019. It is now read-only.

Blocked a frame with origin \"http://localhost:3000\" from accessing a cross-origin frame. #120

Open
wudanjs opened this issue Dec 5, 2018 · 1 comment

Comments

@wudanjs
Copy link

wudanjs commented Dec 5, 2018

node build/dev-server.js 方式启动项目,添加自定义dapp,报如下错误,该怎么解决?
报错如下:
Error occured while trying to injectScriptCode: {"stack":"Error: Blocked a frame with origin "http://localhost:3000\" from accessing a cross-origin frame.\n at injectScriptCode (http://localhost:3000/plugins/cordova-plugin-inappbrowser/src/browser/InAppBrowserProxy.js:210:37)\n at module.exports (http://localhost:3000/cordova.js:997:13)\n at InAppBrowser.executeScript (http://localhost:3000/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js:71:17)\n at Channel.eval (webpack-internal:///./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/pages/dapp/DApp.vue:434:28)\n at Channel.fire (http://localhost:3000/cordova.js:798:23)\n at InAppBrowser._eventHandler (http://localhost:3000/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js:46:43)\n at cb (http://localhost:3000/plugins/cordova-plugin-inappbrowser/www/inappbrowser.js:106:17)\n at Object.callbackFromNative (http://localhost:3000/cordova.js:291:58)\n at Object.callbackSuccess (http://localhost:3000/cordova.js:271:17)\n at onSuccess (http://localhost:3000/cordova.js:970:25)"}

@overcat
Copy link
Member

overcat commented Dec 5, 2018

请尝试配置适当的 CORS Headers. https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants