The page iframe does not support referencing non-business domain names, please reconfigure

Record a pit about the web-view of the mini-program.
Recently, in order to save costs, the company has rewritten the native app with a mini-program. Several of the pages belong to h5, and the app is implemented in the form of opening the web-view. The applet also supports embedded webview, so I developed it step by step according to the process and configured the whitelist of business domain names. As a result, the applet still reported an error, "The page iframe does not support referencing non-business domain names, please reconfigure." Then I searched the code and found nothing. Using iframe, I asked questions in the community and finally solved it.
The original h5 communicates with the native app, using jsbridge and iframe
window.WVJBCallbacks = [callback]
let WVJBIframe = document.createElement('iframe')
WVJBIframe.style.display = 'none'
WVJBIframe.src = 'https:// bridge_loaded '
document.documentElement.appendChild(WVJBIframe)
setTimeout(function() { document.documentElement.removeChild(WVJBIframe) }, 0)

If WeChat told me that "the page iframe does not support referencing non-business domain name https:// bridge_loaded , please reconfigure", it is estimated that the problem has been discovered long ago, hahaha

Guess you like

Origin blog.csdn.net/xinTianou123/article/details/123212791