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 則新訊息