1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actioncable/app/javascript/action_cable
Richard Macklin 39493185d3 Remove explicit document receiver from add/removeEventListener calls
This allows ActionCable to be used in a web worker, where the `document`
global is undefined. Previously, attempting to use ActionCable inside a
web worker would result in this exception after you try to open a
connection:
```
ReferenceError: document is not defined
```

The visibilitychange event won't ever get triggered in a worker, so
adding the listener is effectively a no-op there. But the listener is
mainly a convenience, rather than a critical piece of the javascript
interface, so using ActionCable in a worker will still work. (And you
could listen for visibilitychange yourself in a window script, then tell
the worker to reconnect if you still want that behavior.)
2019-01-15 22:14:33 -08:00
..
adapters.js Replace window references in ActionCable with self 2019-01-14 17:44:35 -08:00
connection.js Simplify this.isActive() && this.webSocket into this.isActive() 2019-01-14 11:52:46 -08:00
connection_monitor.js Remove explicit document receiver from add/removeEventListener calls 2019-01-15 22:14:33 -08:00
consumer.js Remove circular dependency warnings in ActionCable javascript and publish source modules with fine-grained exports (#34370) 2018-12-01 16:25:02 -05:00
index.js Simplify ActionCable.getConfig, Connection#getProtocol, and Connection#close 2019-01-14 11:35:04 -08:00
logger.js Remove circular dependency warnings in ActionCable javascript and publish source modules with fine-grained exports (#34370) 2018-12-01 16:25:02 -05:00
subscription.js Convert ActionCable javascript to ES2015 modules with modern build environment 2018-11-02 08:41:05 -07:00
subscriptions.js Remove circular dependency warnings in ActionCable javascript and publish source modules with fine-grained exports (#34370) 2018-12-01 16:25:02 -05:00