Misc

Using HTTP polling

If you cannot use websocket, you can use http polling, but it's not as nice.

If you cannot use websocket via ActionCable, the debugbar has a fallback mode using HTTP polling. It's not as nice as the websocket, but it works.

If ActionCable isn't found, the debugbar will automatically switch to polling mode (only if using the ERB helper).

It's also possible to pause and resume polling to avoid all those calls in the browser Network tab when debugging.

Configuration

With the ERB helper

1<%= debugbar_javascript mode: :poll %>

You can configure the interval and the URL (if you don't use localhost:3000).

1<%= debugbar_javascript mode: :poll, poll: {
2 url: "http://custom.test:3030",
3 interval: 1000
4 }
5%>

If you don't use the helper, you must define a _debugbarConfigOptions object.

1window._debugbarConfigOptions = {
2 mode: "poll",
3 poll: {
4 url: "http://custom.test:3030",
5 interval: 1000
6 }
7}