Class: Livechat::WidgetsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Livechat::WidgetsController
- Defined in:
- app/controllers/livechat/widgets_controller.rb
Overview
Serves the widget JavaScript as a plain same-origin script. Same-origin
matters: under a script-src 'self' (or nonce-based) CSP, an external
script from the app's own host is always allowed — including when Turbo
Drive swaps the
Instance Method Summary collapse
- #dashboard ⇒ Object
-
#show ⇒ Object
The script URLs carry a content fingerprint (?v=
), so stale code is structurally impossible: new code means a new URL.
Instance Method Details
#dashboard ⇒ Object
23 24 25 |
# File 'app/controllers/livechat/widgets_controller.rb', line 23 def dashboard serve(Widget.dashboard_javascript, Widget.dashboard_fingerprint) end |
#show ⇒ Object
The script URLs carry a content fingerprint (?v=
19 20 21 |
# File 'app/controllers/livechat/widgets_controller.rb', line 19 def show serve(Widget.javascript, Widget.fingerprint) end |