-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Modules using 'requestAnimationFrame' are broken within firefox extensions #3855
Labels
Milestone
Comments
Thanks for the thorough bug post. Pretty easy fix with no downsides. Will probably toss that sucker right in the SEAF |
Thoughts on ;(function ( $, window, document, undefined ) {
...
})( jQuery, (typeof window != 'undefined' && window.Math == Math) ? window : (typeof self != 'undefined' && self.Math == Math) ? self : Function('return this')(), document ); |
jlukic
added a commit
that referenced
this issue
Mar 29, 2016
This should do it |
Argh messed up find & replace. Will fix in another commit. |
sbdchd
added a commit
to getlinky/linky
that referenced
this issue
Jan 17, 2017
Currently a bug with vue <transition> and firefox extensions which results in TypeError: 'requestAnimationFrame' called on an object that does not implement interface Window. Stack trace: zt@resource://gre/modules/ExtensionContent.jsm -> moz-extension://3b35a7b5-6bf4-744d-900b-04c8768fdd55/js/content_script.js:6:30523 Gt@resource://gre/modules/ExtensionContent.jsm -> moz-extension://3b35a7b5-6bf4-744d-900b-04c8768fdd55/js/content_script.js:7:551 tn@resource://gre/modules/ExtensionContent.jsm -> moz-extension://3b35a7b5-6bf4-744d-900b-04c8768fdd55/js/content_script.js:7:1640 d@resource://gre/modules/ExtensionContent.jsm -> moz-extension://3b35a7b5-6bf4-744d-900b-04c8768fdd55/js/content_script.js:6:23084 o@resource://gre/modules/ExtensionContent.jsm -> moz-extension://3b35a7b5-6bf4-744d-900b-04c8768fdd55/js/content_script.js:6:22291 xt/<@resource://gre/modules/ExtensionContent.jsm -> moz-extension://3b35a7b5-6bf4-744d-900b-04c8768fdd55/js/content_script.js:6:26311 we/e.prototype._update@resource://gre/modules/ExtensionContent.jsm -> moz-extension://3b35a7b5-6bf4-744d-900b-04c8768fdd55/js/content_script.js:6:10301 we/e.prototype._mount/n._watcher<@resource://gre/modules/ExtensionContent.jsm -> moz-extension://3b35a7b5-6bf4-744d-900b-04c8768fdd55/js/content_script.js:6:10082 Ji.prototype.get@resource://gre/modules/ExtensionContent.jsm -> moz-extension://3b35a7b5-6bf4-744d-900b-04c8768fdd55/js/content_script.js:7:26477 Ji.prototype.run@resource://gre/modules/ExtensionContent.jsm -> moz-extension://3b35a7b5-6bf4-744d-900b-04c8768fdd55/js/content_script.js:7:27130 z@resource://gre/modules/ExtensionContent.jsm -> moz-extension://3b35a7b5-6bf4-744d-900b-04c8768fdd55/js/content_script.js:6:4802 Ai</</<@resource://gre/modules/ExtensionContent.jsm -> moz-extension://3b35a7b5-6bf4-744d-900b-04c8768fdd55/js/content_script.js:7:23148 e@resource://gre/modules/ExtensionContent.jsm -> moz-extension://3b35a7b5-6bf4-744d-900b-04c8768fdd55/js/content_script.js:7:22607 see Semantic-Org/Semantic-UI#3855
This was referenced Sep 9, 2017
I still get this error when I try to put angular as a content script.... (Which can be solved with the workarond proposed by the OP) |
NoxHarmonium
added a commit
to NoxHarmonium/reagent
that referenced
this issue
Jul 30, 2019
* Browser extensions in Firefox have a weird issue where functions that are on the DOM or on window cannot be assigned to a variable without being bound to the context they came from * Related links: ** https://lwhorton.github.io/2018/10/20/clojurescript-interop-with-javascript.html#pitfalls ** https://github.com/bvaughn/react-virtualized/pull/1013/files ** Semantic-Org/Semantic-UI#3855
NoxHarmonium
added a commit
to NoxHarmonium/reagent
that referenced
this issue
Aug 29, 2019
* Browser extensions in Firefox have a weird issue where functions that are on the DOM or on window cannot be assigned to a variable without being bound to the context they came from * Related links: ** https://lwhorton.github.io/2018/10/20/clojurescript-interop-with-javascript.html#pitfalls ** https://github.com/bvaughn/react-virtualized/pull/1013/files ** Semantic-Org/Semantic-UI#3855
NoxHarmonium
added a commit
to NoxHarmonium/reagent
that referenced
this issue
Sep 7, 2019
* Browser extensions in Firefox have a weird issue where functions that are on the DOM or on window cannot be assigned to a variable without being bound to the context they came from * Related links: ** https://lwhorton.github.io/2018/10/20/clojurescript-interop-with-javascript.html#pitfalls ** https://github.com/bvaughn/react-virtualized/pull/1013/files ** Semantic-Org/Semantic-UI#3855
NoxHarmonium
added a commit
to NoxHarmonium/reagent
that referenced
this issue
Sep 21, 2019
* Browser extensions in Firefox have a weird issue where functions that are on the DOM or on window cannot be assigned to a variable without being bound to the context they came from * Related links: ** https://lwhorton.github.io/2018/10/20/clojurescript-interop-with-javascript.html#pitfalls ** https://github.com/bvaughn/react-virtualized/pull/1013/files ** Semantic-Org/Semantic-UI#3855
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I guess all of semantic-ui's modules are invoked like this.. more or less
This works fine in the usual browser window environment but fails for example if you invoke the sidebar module from a Firefox extension's content script.
TypeError: 'requestAnimationFrame' called on an object that does not implement interface Window.
Other famous JS libraries fixed similar issues by replacing the
window
object with the "real" global object. see:lodash/lodash#1340
zloirock/core-js#91
I was able to fix the error by adding the following code (extracted from core-js) to the sidebar module:
TC39 is also making some efforts in this direction but the proposed
getGlobal
function is not reliable within Firefox extensions: https://github.com/tc39/proposal-global#rationaleThe text was updated successfully, but these errors were encountered: