From d74dd80540824b86fc93fc9573f412bbbcaefbc4 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 22 Feb 2019 15:41:33 +0000 Subject: [PATCH] Improve detection of browsers needing ES6 shims --- config/initializers/browser.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/config/initializers/browser.rb b/config/initializers/browser.rb index 167fd293c..29dc70672 100644 --- a/config/initializers/browser.rb +++ b/config/initializers/browser.rb @@ -2,15 +2,19 @@ module OpenStreetMap module Browser module Features def html5? - webkit? || firefox? || safari? || edge? || ie?(">8") + chrome? || firefox? || safari? || edge? || ie?(">8") || generic_webkit? end def es5? - webkit? || firefox? || safari? || edge? || ie?(">8") + chrome? || firefox? || safari? || edge? || ie?(">8") || generic_webkit? end def es6? - webkit? || firefox? || safari? || edge? + chrome?(">44") || firefox?(">24") || safari?(">7") || edge?(">11") || generic_webkit? + end + + def generic_webkit? + webkit? && !chrome? && !safari? && !edge? end end end -- 2.39.5