gpt4 book ai didi

google-translate - 谷歌翻译已停止在 Chrome 中工作

转载 作者:行者123 更新时间:2023-12-04 23:36:03 24 4
gpt4 key购买 nike

谷歌翻译已停止在 Chrome 中工作,但仍在 Firefox 中工作。代码在下面,它已经工作了很长时间:

<script>
function googleSectionalElementInit() {
new google.translate.SectionalElement({
sectionalNodeClassName: 'can-translate',
controlNodeClassName: 'translation-control',
background: '#ffffcc'
}, 'google_sectional_element');
}
var url = top.location.href,
pos = url.search(/\/\w\w(\W|$)/),
lang = url.substring(pos+1,pos+3),
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = false;
ga.src = 'https://translate.google.com/translate_a/element.js?cb=googleSectionalElementInit&ug=section&hl='+lang;
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
})();
</script>

目前这里是错误:

Cross-Origin Read Blocking (CORB) blocked cross-origin response https://translate.googleapis.com/translate_a/l?client=te&alpha=true&hl=en&cb=_callbacks____0jtqeel7c with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details.



如果转到建议的链接,这里是建议:

Make sure these resources are served with a correct "Content-Type" response header from the list below, as well as a "X-Content-Type-Options: nosniff" response header.



还有消息在 https://translate.google.com/intl/en/about/website/

We no longer provide new access to Google Translate's Website Translator. This change does not affect existing use of the Website Translator.



这仅在 Chrome 中有效,上面的代码仅适用于 Google,我不知道在哪里以及如何添加 "X-Content-Type-Options: nosniff" .

UPD:有两个必要的标题。

谷歌是否屏蔽了自己,有谁知道如何修复它?

UPD1:Google 翻译错误开始出现,Firefox 66.0.1 也开始出现。这是

The resource from “https://translate.googleapis.com/translate_a/l?client=te&alpha=true&hl=en&cb=_callbacks____0jttrta1j” was blocked due to MIME type (“application/json”) mismatch (X-Content-Type-Options: nosniff).



它看起来像是翻译服务的一些小故障,在一个页面刷新后它可以工作,然后又一个 - 服务器返回不正确的数据,json 而不是 javascript 或类似的东西

最佳答案

此时,如果您手动删除主机.translate.googleapis.com 的名称为“NID”的cookie,则可以处理该页面(CORB 错误消失)

顺便说一句,重复的页面调用有时也会消除此错误。但问题的解决方法和它的发生一样奇怪。

关于google-translate - 谷歌翻译已停止在 Chrome 中工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55372689/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com