Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firefox扩展中报错 #59

Closed
Mr-Quin opened this issue Feb 5, 2025 · 0 comments · Fixed by #60
Closed

Firefox扩展中报错 #59

Mr-Quin opened this issue Feb 5, 2025 · 0 comments · Fixed by #60
Labels

Comments

@Mr-Quin
Copy link
Contributor

Mr-Quin commented Feb 5, 2025

在Firefox扩展中尝试渲染弹幕会出现以下错误

TypeError: 'requestAnimationFrame' called on an object that does not implement interface Window.

Image

出错位置

function play() {
  if (!this._.visible || !this._.paused) {
    return this;
  }
  this._.paused = false;
  if (this.media) {
    for (var i = 0; i < this._.runningList.length; i++) {
      var cmt = this._.runningList[i];
      cmt._utc = Date.now() / 1e3 - (this.media.currentTime - cmt.time);
    }
  }
  var that = this;
  var engine = createEngine(
    this._.engine.framing.bind(this),
    this._.engine.setup.bind(this),
    this._.engine.render.bind(this),
    this._.engine.remove.bind(this)
  );
  function frame() {
    engine.call(that);
    that._.requestID = raf(frame);
  }
  this._.requestID = raf(frame);  // <--------------------------
  return this;
}

cancelAnimationFrame同样报错

其他地方类似的问题:
facebook/react#16606
mui/material-ui#44986
taye/interact.js#810

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants