Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Aug 11, 2025. It is now read-only.

Conversation

@sonicmax
Copy link

TypeError: 'setTimeout' called on an object that does not implement interface Window.
Stack trace:
draw@moz-extension://3a5e5281-7f0c-437e-afde-3d0a4ecf512d/lib/pikaday/pikaday.js:983:21
adjustCalendars@moz-extension://3a5e5281-7f0c-437e-afde-3d0a4ecf512d/lib/pikaday/pikaday.js:852:13
gotoDate@moz-extension://3a5e5281-7f0c-437e-afde-3d0a4ecf512d/lib/pikaday/pikaday.js:817:13
setDate@moz-extension://3a5e5281-7f0c-437e-afde-3d0a4ecf512d/lib/pikaday/pikaday.js:772:13
Pikaday/self._onMouseDown@moz-extension://3a5e5281-7f0c-437e-afde-3d0a4ecf512d/lib/pikaday/pikaday.js:435:21

I had this issue after porting a Chrome extension to Firefox. The datepicker fails to open as the sto() call in Pikaday.draw() throws an exception and stops execution.

I'm not sure exactly what the difference in behaviour is caused by (possibly some kind of security feature?) but binding the window object to setTimeout prevents the errors and doesn't seem to affect functionality in any browsers I tested. Testing for Function.prototype.bind makes sure that the fix doesn't break compatibility for older browsers.

sto() calls throw TypeErrors in Firefox add-ons if the Window object is not
explicitly bound to the setTimeout() method.

(TypeError: 'setTimeout' called on an object that does not implement interface Window.)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.