Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Side by Side Diff: bower_components/gif.js/src/browser.coffee

Issue 786953007: npm_modules: Fork bower_components into Polymer 0.4.0 and 0.5.0 versions (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « bower_components/gif.js/src/benchmark.coffee ('k') | bower_components/gif.js/src/gif.coffee » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 ### CoffeeScript version of the browser detection from MooTools ###
2
3 ua = navigator.userAgent.toLowerCase()
4 platform = navigator.platform.toLowerCase()
5 UA = ua.match(/(opera|ie|firefox|chrome|version)[\s\/:]([\w\d\.]+)?.*?(safari|ve rsion[\s\/:]([\w\d\.]+)|$)/) or [null, 'unknown', 0]
6 mode = UA[1] == 'ie' && document.documentMode
7
8 browser =
9 name: if UA[1] is 'version' then UA[3] else UA[1]
10 version: mode or parseFloat(if UA[1] is 'opera' && UA[4] then UA[4] else UA[2] )
11
12 platform:
13 name: if ua.match(/ip(?:ad|od|hone)/) then 'ios' else (ua.match(/(?:webos|an droid)/) or platform.match(/mac|win|linux/) or ['other'])[0]
14
15 browser[browser.name] = true
16 browser[browser.name + parseInt(browser.version, 10)] = true
17 browser.platform[browser.platform.name] = true
18
19 module.exports = browser
OLDNEW
« no previous file with comments | « bower_components/gif.js/src/benchmark.coffee ('k') | bower_components/gif.js/src/gif.coffee » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698