我找不到任何資訊,為什么 Windows 10 上的 Firefox v91.10.0esr 抱怨requestAnimationFrame未定義:
const worker = new Worker(
URL.createObjectURL(
new Blob(
["requestAnimationFrame(() => this.postMessage('requestAnimationFrame in web-worker process'))"]
, { type: "text/javascript" })));
worker.addEventListener("message", e =>
{
console.log(e.data);
});
requestAnimationFrame(() => console.log("requestAnimationFrame in main process"));
19:09:53.100 ReferenceError: requestAnimationFrame is not defined 569ddce0-b6c3-47c9-88b4-89d59445b335:1:1
<anonymous> blob:null/569ddce0-b6c3-47c9-88b4-89d59445b335:1
它在 Android Firefox 和其他瀏覽器(Edge、Chrome)上運行良好。
有任何想法嗎?
uj5u.com熱心網友回復:
Firefox 在 v97 的作業人員中添加了對 requestAnimationFrame 和 cancelAnimationFrame 的支持,正如您在這個問題上看到的那樣。評論 17 和 18只是確認它。
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/492771.html
標籤:javascript 火狐 网络工作者 请求动画帧
上一篇:Firefox上的Reactjscypress:錯誤:在瀏覽器中找不到url目標about:blank。目標是[]
