chore: comment out deprecated allow_browser code
- Commented out the `allow_browser` lines to prevent disabling access for unsupported browsers. - This change maintains previous behavior without removing the code permanently, allowing for future reference. - The previous implementation was causing issues with newer browser versions, prompting the need for a review of browser support policies.
This commit is contained in:
parent
2e438166ee
commit
29de36f5fb
@ -3,50 +3,50 @@ class ApplicationController < ActionController::Base
|
|||||||
# Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has.
|
# Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has.
|
||||||
before_action :log_browser_info
|
before_action :log_browser_info
|
||||||
# allow_browser versions: :modern
|
# allow_browser versions: :modern
|
||||||
allow_browser versions: :modern,
|
# allow_browser versions: :modern,
|
||||||
patterns: [
|
# patterns: [
|
||||||
# 鸿蒙系统相关
|
# # 鸿蒙系统相关
|
||||||
/OpenHarmony/, # 鸿蒙系统标识
|
# /OpenHarmony/, # 鸿蒙系统标识
|
||||||
/ArkWeb\/[\d.]+/, # 鸿蒙浏览器内核
|
# /ArkWeb\/[\d.]+/, # 鸿蒙浏览器内核
|
||||||
/Mobile HuaweiBrowser/, # 华为浏览器(新格式)
|
# /Mobile HuaweiBrowser/, # 华为浏览器(新格式)
|
||||||
/HuaweiBrowser\/[\d.]+/, # 华为浏览器(旧格式)
|
# /HuaweiBrowser\/[\d.]+/, # 华为浏览器(旧格式)
|
||||||
|
#
|
||||||
# 夸克浏览器(更宽松的匹配)
|
# # 夸克浏览器(更宽松的匹配)
|
||||||
/Quark[\s\/][\d.]+/, # 匹配 "Quark/7.4.6.681" 或 "Quark 7.4.6.681"
|
# /Quark[\s\/][\d.]+/, # 匹配 "Quark/7.4.6.681" 或 "Quark 7.4.6.681"
|
||||||
|
#
|
||||||
/Mobile Safari/,
|
# /Mobile Safari/,
|
||||||
/Chrome\/[\d.]+/,
|
# /Chrome\/[\d.]+/,
|
||||||
/Quark\/[\d.]+/,
|
# /Quark\/[\d.]+/,
|
||||||
/HuaweiBrowser\/[\d.]+/,
|
# /HuaweiBrowser\/[\d.]+/,
|
||||||
/MiuiBrowser\/[\d.]+/,
|
# /MiuiBrowser\/[\d.]+/,
|
||||||
/VivoBrowser\/[\d.]+/,
|
# /VivoBrowser\/[\d.]+/,
|
||||||
/OppoBrowser\/[\d.]+/,
|
# /OppoBrowser\/[\d.]+/,
|
||||||
/UCBrowser\/[\d.]+/,
|
# /UCBrowser\/[\d.]+/,
|
||||||
/QQBrowser\/[\d.]+/,
|
# /QQBrowser\/[\d.]+/,
|
||||||
/MicroMessenger\/[\d.]+/,
|
# /MicroMessenger\/[\d.]+/,
|
||||||
/Alipay/,
|
# /Alipay/,
|
||||||
/BaiduBoxApp/,
|
# /BaiduBoxApp/,
|
||||||
/baiduboxapp/i,
|
# /baiduboxapp/i,
|
||||||
/SogouMobile/,
|
# /SogouMobile/,
|
||||||
/Weibo/,
|
# /Weibo/,
|
||||||
/DingTalk/,
|
# /DingTalk/,
|
||||||
/ToutiaoMicroApp/,
|
# /ToutiaoMicroApp/,
|
||||||
/BytedanceWebview/,
|
# /BytedanceWebview/,
|
||||||
/ArkWeb/
|
# /ArkWeb/
|
||||||
],
|
# ],
|
||||||
on_failure: ->(browser) {
|
# on_failure: ->(browser) {
|
||||||
Rails.logger.warn <<~BROWSER_INFO
|
# Rails.logger.warn <<~BROWSER_INFO
|
||||||
Browser Blocked:
|
# Browser Blocked:
|
||||||
User Agent: #{browser.ua}
|
# User Agent: #{browser.ua}
|
||||||
Name: #{browser.name}
|
# Name: #{browser.name}
|
||||||
Version: #{browser.version}
|
# Version: #{browser.version}
|
||||||
Platform: #{browser.platform.name}
|
# Platform: #{browser.platform.name}
|
||||||
Device: #{browser.device.name}
|
# Device: #{browser.device.name}
|
||||||
Mobile: #{browser.mobile?}
|
# Mobile: #{browser.mobile?}
|
||||||
Modern: #{browser.modern?}
|
# Modern: #{browser.modern?}
|
||||||
Bot: #{browser.bot?}
|
# Bot: #{browser.bot?}
|
||||||
BROWSER_INFO
|
# BROWSER_INFO
|
||||||
}
|
# }
|
||||||
before_action :set_locale
|
before_action :set_locale
|
||||||
after_action :track_action
|
after_action :track_action
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user