
但换 Edge 浏览器则没有问题。等了一天,也不见财新网解决这个问题,于是问财新网的客服。
chrome://flags/#same-site-by-default-cookies
财新客服
chrome://flags/#cookies-without-same-site-must-be-secure
两项设置为Disabled
原来是跨站 Cookie 的问题。
按财新客服的设置确实可以解决这个问题,但 Chrome 限制跨站 Cookie 是有理由的,因为这些可以用来跨站跟踪。
那么有其他安全的解决方案吗?
有的,使用 HTTPS 。但是财新网的链接默认都不是 HTTPS 的,于是我改写了这段 js 来跳转。(原脚本地址: https://greasyfork.org/en/scripts/38930-force-http-to-https)
// ==UserScript== | |
// @name Force Caixin to HTTPS | |
// @namespace r-a-y/https | |
// @version 1.0.0 | |
// @match http://*.caixin.com/* | |
// @run-at document-start | |
// @description Force Caixin to use HTTPS. | |
// ==/UserScript== | |
document.location.replace(document.location.href.replace(/http\:/, 'https:')); |
Chrome 用户可以安装 Tampermonkey 来使用以上脚本。
这样就不需要按财新客服的建议降低浏览器的安全设置。
财新网你什么时候默认启用 HTTPS 呢?