没有不值得去解决的问题,也没有不值得去学习的技术!

在 Google Chrome 浏览器中,今日头条打开后,一片空白的分析解决

查看 Console,报错:Access to XMLHttpRequest at 'https://verify.snssdk.com/reportError' from origin 'https://www.toutiao.com' has been blocked by CORS policy: Request header field ra-ver is not allowed by Access-Control-Allow-Headers in preflight response.

1、在 Google Chrome 浏览器中,今日头条打开后,一片空白,如图1

在 Google Chrome 浏览器中,今日头条打开后,一片空白
图1
Plaintext

Request URL: https://verify.snssdk.com/reportError
Referrer Policy: no-referrer-when-downgrade

2、查看 Console,报错:Access to XMLHttpRequest at ‘https://verify.snssdk.com/reportError’ from origin ‘https://www.toutiao.com’ has been blocked by CORS policy: Request header field ra-ver is not allowed by Access-Control-Allow-Headers in preflight response.如图2

查看 Console,报错:Access to XMLHttpRequest at 'https://verify.snssdk.com/reportError' from origin 'https://www.toutiao.com' has been blocked by CORS policy: Request header field ra-ver is not allowed by Access-Control-Allow-Headers in preflight response.
图2

3、清除浏览数据,包含基本与高级,仍然一片空白,如图3

清除浏览数据,包含基本与高级,仍然一片空白
图3

4、打开新的无痕窗口,今日头条打开后,正常,查看 Console,未报错,如图4

打开新的无痕窗口,今日头条打开后,正常,查看 Console,未报错
图4
Plaintext

version:0.1.7
pc_text.js:1 version:0.1.7
(index):1 A cookie associated with a cross-site resource at http://i.snssdk.com/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.
vendor.e2caf4792c6de5bf3950.js:112 [tea-sdk][default]已禁止默认上报predefine_pageview事件,需手动上报。
VM15:1 
raven.js:1 [tea-sdk][default]看到本提示,意味着用户信息已完全就绪,上报通道打开。用户标识如下:
raven.js:1 [tea-sdk][default] {
  "user_unique_id": "6799972943449261575",
  "web_id": "6799972943449261575",
  "ssid": "e58f1dbf-0ff2-4702-94b4-6cc59d325369"
}
raven.js:1 [tea-sdk] SDK已经初始化过了!请检查是否多次引入了SDK文件
e. @ raven.js:1
2p3.pstatp.com/list/240x240/6799949924902619915:1 Failed to load resource: the server responded with a status of 400 (Bad Request)
(index):1 A cookie associated with a cross-site resource at https://xxbg.snssdk.com/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.
p3.pstatp.com/list/240x240/6799949924902619915:1 Failed to load resource: the server responded with a status of 400 (Bad Request)

5、对比请求:https://verify.snssdk.com/reportError 的响应,一为无响应,一为有响应。如图5

对比请求:https://verify.snssdk.com/reportError 的响应,一为无响应,一为有响应。
图5
JSON

{"code":"200","data":null,"msg":""}

6、发现无痕模式下,新增加了下载APP、注册头条号等链接,隐约记得之前是没有的。那么这次打开后一片空白的原因,可能在于今日头条升级了新版本,不兼容导致的。如图6

发现无痕模式下,新增加了下载APP、注册头条号等链接,隐约记得之前是没有的。那么这次打开后一片空白的原因,可能在于今日头条升级了新版本,不兼容导致的。
图6

7、最后在360软件管家中,卸载了 Google Chrome 浏览器,如图7

最后在360软件管家中,卸载了 Google Chrome 浏览器
图7

8、卸载时,勾选同时删除你的浏览数据吗?如图8

卸载时,勾选同时删除你的浏览数据吗?
图8

9、重新安装 Google Chrome 浏览器,再次打开今日头条,正常,如图9

重新安装 Google Chrome 浏览器,再次打开今日头条,正常
图9

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系