History

Log "unsupported browser" events

Thibaut committed 12 years ago

Commit e8d402a1 parent 45b54931 file · +14 −7Browse files

Unified · Split

assets/javascripts/app/app.coffee+14−7
@@ -147,13 +147,20 @@ · 146 unmodified lines
147147
148148 isSupportedBrowser: ->
149149 try
150− return true if Function::bind and
151− history.pushState and
152− window.matchMedia and
153− document.body.classList and
154− document.body.insertAdjacentHTML and
155− document.createEvent('CustomEvent').defaultPrevented is false and
156− getComputedStyle(document.querySelector('._header')).backgroundImage isnt 'none'
150+ features =
151+ bind: !!Function::bind
152+ pushState: !!history.pushState
153+ matchMedia: !!window.matchMedia
154+ classList: !!document.body.classList
155+ insertAdjacentHTML: !!document.body.insertAdjacentHTML
156+ defaultPrevented: document.createEvent('CustomEvent').defaultPrevented is false
157+ cssGradients: getComputedStyle(document.querySelector('._header')).backgroundImage isnt 'none'
158+
159+ for key, value of features when not value
160+ Raven.captureMessage 'unsupported', extra: { feature: key }
161+ return false
162+
163+ true
157164 catch error
158165 Raven.captureMessage 'unsupported exception', extra: { error: error, name: error.name, message: error.message }
159166 false