]> git.openstreetmap.org Git - rails.git/blob - config/initializers/browser.rb
Move more api-only methods into api_controller
[rails.git] / config / initializers / browser.rb
1 module OpenStreetMap
2   module Browser
3     module Features
4       def html5?
5         chrome? || firefox? || safari? || edge? || ie?(">8") || generic_webkit?
6       end
7
8       def es5?
9         chrome? || firefox? || safari? || edge? || ie?(">8") || generic_webkit?
10       end
11
12       def es6?
13         chrome?(">44") || firefox?(">24") || safari?(">7") || edge?(">11") || generic_webkit?
14       end
15
16       def generic_webkit?
17         webkit? && !chrome? && !safari? && !edge?
18       end
19     end
20   end
21 end
22
23 Browser::Base.include(OpenStreetMap::Browser::Features)