mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
ac8ffbe76a
Before this change, attempting to use ActionCable inside a web worker would result in an exception being thrown: ``` ReferenceError: window is not defined ``` By replacing the `window` reference with `self`, which is available in both a window context and a worker context, we can avoid this error. Ref: https://developer.mozilla.org/en-US/docs/Web/API/Window/self
4 lines
71 B
JavaScript
4 lines
71 B
JavaScript
export default {
|
|
logger: self.console,
|
|
WebSocket: self.WebSocket
|
|
}
|