Skip to content

Use the native allow_browser guard instead of a disabled custom concern#108

Open
ashwin47 wants to merge 1 commit into
mainfrom
remove-dead-browser-gating
Open

Use the native allow_browser guard instead of a disabled custom concern#108
ashwin47 wants to merge 1 commit into
mainfrom
remove-dead-browser-gating

Conversation

@ashwin47

@ashwin47 ashwin47 commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Browser version gating was implemented as a custom AllowBrowser concern that had been turned into a no-op, plus an orphaned multilingual "unsupported browser" view that nothing rendered. The whole cluster — concern, view, and its i18n string — only existed to point at itself.

This swaps that ~40 lines of dead/custom code for Rails' built-in allow_browser versions: :modern in ApplicationController. The guard is now actually active: outdated browsers (Safari <17.2, Chrome <120, Firefox <121, IE) get the existing styled public/406-unsupported-browser.html instead of being silently served.

Non-browser clients (health checks, bots, API, native webviews) are unaffected — allow_browser only acts on user agents it recognizes as old browsers. Modern Hotwire Native iOS rides on current Safari, so it stays above the threshold.

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant