RxJS 5个Firefox网络扩展:类型错误:的Math.random不是一个函数
问题描述:
RxJS 5时失败,如Firefox网页扩展内容脚本,并给予注射以下错误的工作:TypeError: a.Math.random is not a function TypeError: Rx.Subject is not a constructor
RxJS 5个Firefox网络扩展:类型错误:的Math.random不是一个函数
答
找到了解决办法,在问题发生,因为在Firefox内容脚本window.Math没有定义,而是全局定义为Math而不是窗口对象。 RxJS 5正在寻找window.Math。因此,在RxJS库之前添加以下行,它将工作于Firefox。 window.Math = Math
编号:https://github.com/ReactiveX/rxjs/issues/2446#issuecomment-286908341