Unified · Split
| @@ -147,13 +147,20 @@ · 146 unmodified lines | ||
| 147 | 147 | |
| 148 | 148 | isSupportedBrowser: -> |
| 149 | 149 | 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 | |
| 157 | 164 | catch error |
| 158 | 165 | Raven.captureMessage 'unsupported exception', extra: { error: error, name: error.name, message: error.message } |
| 159 | 166 | false |