I used interact.js in my extension and encountered this problem. I fixed this question to interact.js (see Fix the problem that the draggable function does not work properly in Firefox extensions by lmk123 · Pull Request #810 · taye/interact.js · GitHub), but I think it looks more like an Firefox extension issue: why cancelAnimationFrame
must be run in window
context in the content script?
Steps to reproduce:
- Clone https://github.com/lmk123/firefox-addon-interactjs-bug
- In Firefox: Open the
about:debugging
page, click “This Firefox” (in newer versions of Firefox), click “Load Temporary Add-on”, then select manifest.json file in the extension’s directory. - Open https://www.google.com, a “drag me” text will appear in the upper left corner
- Open dev tools, switch to the “Debugger” tab, and check the “Pause on exceptions” option on the right
- Now, drag the “drag me” text
You will see this error in Debugger:
You can edit manifest.json, replace interact.js
to interact-fixed.js
, reload the extension and the
google web page, now everything work fine.