2024年6月



XXX has been blocked by CORS policy: The request client is not a secure context and the resource is in more-private address space private

处理方法:

1.在google浏览器地址栏输入chrome://flags/#block-insecure-private-network-requests回车,并设置block-insecure-private-network-requests为“disabled”,重启浏览器。
2.检查调用资源的域名DNS是否为内网地址,添加本地解析。

chromium启动报如下错误:
[W:pyppeteer.chromium_downloader] chromium extracted to: /root/.local/share/pyppeteer/local-chromium/494755
LaunchProcess: failed to execvp:
/root/.local/share/pyppeteer/local-chromium/494755/chrome-linux/nacl_helper
[62381:62381:0612/152237.227605:ERROR:nacl_fork_delegate_linux.cc(315)] Bad NaCl helper startup ack (0 bytes)

(chrome:62378): Gtk-WARNING **: 15:22:37.231: cannot open display:

经过网上查询驱动、chromium版本、使用--no-sandbox参数、创建非root用户启动等都无效,修改headless参数为true。