Deprecating support for XHR

已查看 895 次
跳至第一个未读帖子

Sam Dutton

未读,
2023年8月11日 10:39:212023/8/11
收件人 Topics API announcements

Hi all,


The initial Topics proposal required developers to create a cross-origin iframe from which they would call the Topics JavaScript API. We received feedback that this requirement could have a negative performance impact for developers and users. As a result, we announced support for Topics via headers beginning in Chrome 111, in requests initiated via Fetch and (temporarily) XHR. 


While documentation noted that “Inclusion of the topics header in XHR requests is only available temporarily, and support will be removed in the future”, there is a cross-browser agreement that discourages shipping XHR support beyond the Privacy Sandbox origin trial. As Topics begins its ramp up, XHR support will only be included for users for whom the origin trial features were enabled and will be fully deprecated when the individual origin trial experiment groups are merged, likely within the next couple of weeks. 


If you’re currently using Topics with XHR, your sites will not break. The topics just won’t be added to your XHR request headers. We recommend that you either transition to Fetch for your request, or use the iframe browsingtopics attribute or the document.browsingTopics() JavaScript API to retrieve topics. Fetch is supported by all modern browsers, but not Internet Explorer or Opera Mini.


We regret the last minute notice, and encourage any developers experiencing breakage or inconvenience to reply to this thread with more details.


回复全部
回复作者
转发
0 个新帖子