layui框架实战案例(4):因内容安全策略导致弹出层模态框无法正常显示微信公众号文章使用window.open的解决方案

layui框架实战案例(4):因内容安全策略导致弹出层模态框无法正常显示微信公众号文章使用window.open的解决方案_第1张图片

in a frame because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self'

解决方案

/*弹出窗口*/
function getWin(URL, name) {
    var bschitchat = window.open(URL, name, 'toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no');
    bschitchat.moveTo(0, 0);
    bschitchat.resizeTo(screen.availWidth, screen.availHeight);
    bschitchat.outerWidth = screen.availWidth;
    bschitchat.outerHeight = screen.availHeight;
}

Done!

你可能感兴趣的:(layui)