mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-06-15 14:40:53 -04:00
Browser detection: Add Atom shell
As it a an unsual mix of both node and browser environment at the same time
This commit is contained in:
parent
f193acf31b
commit
f1348931bb
1 changed files with 3 additions and 1 deletions
|
@ -82,7 +82,7 @@ var PaperScope = Base.extend(/** @lends PaperScope# */{
|
|||
// here: { chrome: true, webkit: false }, mozilla missing is the
|
||||
// only difference to jQuery.browser
|
||||
navigator.userAgent.toLowerCase().replace(
|
||||
/(opera|chrome|safari|webkit|firefox|msie|trident)\/?\s*([.\d]+)(?:.*version\/([.\d]+))?(?:.*rv\:([.\d]+))?/g,
|
||||
/(opera|chrome|safari|webkit|firefox|msie|trident|atom)\/?\s*([.\d]+)(?:.*version\/([.\d]+))?(?:.*rv\:([.\d]+))?/g,
|
||||
function(all, n, v1, v2, rv) {
|
||||
// Do not set additional browsers once chrome is detected.
|
||||
if (!browser.chrome) {
|
||||
|
@ -101,6 +101,8 @@ var PaperScope = Base.extend(/** @lends PaperScope# */{
|
|||
);
|
||||
if (browser.chrome)
|
||||
delete browser.webkit;
|
||||
if (browser.atom)
|
||||
delete browser.chrome;
|
||||
}
|
||||
/*#*/ } // __options.environment == 'browser'
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue