Skip to content

Commit

Permalink
👊
Browse files Browse the repository at this point in the history
  • Loading branch information
deavial committed Aug 14, 2017
1 parent e2dc8b2 commit 5442738
Show file tree
Hide file tree
Showing 11 changed files with 758 additions and 71 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Starting to add automated test suite

### 1.3.1 (August 13, 2017)
* Fixed issue where Opera 12 through 14 were detecting as Chrome, WebKit, and Opera
* Added defunctr.browser which will replace defunctr.detective in 2.0
* Deprecated defunctr.detective
* Updated build to current versions
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,14 @@ We support most browsers, which is the point of using our module in the first pl

#### Things to know about this release

* Microsoft Edge is detected as Microsoft Edge not Internet Explorer.
* Opera Next is detected as Opera-Next not Opera.
* Only Internet Explorer is supported for version information.
* Kindle Fire has an issue where it is detected as Khtml and Chrome.
* Android Emulators are unpredictable and may report Chrome as Safari or even Khtml.
* All 3rd party browsers (Chome, Firefox) will be **correctly** detected as Safari on iOS. All browsers on iOS are required to use Apple's provided frameworks for accessing the web. These browsers are only shells around Safari.
* `Defunctr` is deprecated and will be removed in 2.0. Use `defunctr` instead.
* `defunctr.detective` is deprecated and will be removed in 2.0. Use `defunctr.browser()` instead.
* Known issue with crashing on IE 6 actual (vs quirks emulation). Investigation under way.

### CDN Delivery

Expand Down
62 changes: 46 additions & 16 deletions dist/defunctr-dev.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*!
* Defunctr 1.3.0
* Defunctr 1.3.1
* https://github.com/cinecove/defunctr
*
* Copyright 2012 - 2017 Cinecove Digital, LLC and other contributors
* Released under the MIT license
* https://github.com/cinecove/defunctr/blob/master/LICENSE.md
*
* Build Date: 2017-02-10T07:58:02.681Z
* Build Date: 2017-08-14T02:37:48.958Z
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
Expand All @@ -22,12 +22,12 @@ var noop = function noop() {};
var console = browserWindow && browserWindow.console ? browserWindow.console : undefined;
var log = console ? console.log || noop : noop;
var warn = console ? console.warn || log : noop;
var error$1 = console ? console.error || log : noop;
var error = console ? console.error || log : noop;

var logger = {
log: log,
warn: warn,
error: error$1
error: error
};

var htmlElementConstructorCheck = function () {
Expand Down Expand Up @@ -67,8 +67,16 @@ var firefox = function () {
return installTriggerCheck();
};

var operaVersionCheck = function () {
return Boolean(browserWindow && browserWindow.opera && browserWindow.opera.version !== undef);
};

var opera = function () {
return operaVersionCheck();
};

var webkit = function () {
return webKitTransformCheck() && msWriteProfilerMarkCheck() === false && !firefox();
return webKitTransformCheck() && msWriteProfilerMarkCheck() === false && !firefox() && !opera();
};

var chrome = function () {
Expand All @@ -95,14 +103,6 @@ var khtml = function () {
return khtmlMarqueeCheck() && !safari();
};

var operaVersionCheck = function () {
return Boolean(browserWindow && browserWindow.opera && browserWindow.opera.version !== undef);
};

var opera = function () {
return operaVersionCheck();
};



var ie = function () {
Expand Down Expand Up @@ -491,20 +491,50 @@ var tagger = function (detective) {
var Defunctr = function Defunctr() {
classCallCheck(this, Defunctr);

this.version = '1.3.0';
this.detective = new Detective();
this.version = '1.3.1';
this.browser = function browser() {
var d = new Detective();
return {
vendor: d.isChrome ? 'chrome' : d.isEdge ? 'edge' : d.isFirefox ? 'firefox' : d.isIE ? 'ie' : d.isKhtml ? 'khtml' : d.isOpera && d.isOperaNext ? 'opera' : d.isSafari ? 'safari' : 'unknown',
version: !d.isIE ? 0 : d.ieIsBelowVersion6 ? 5 : d.ieIsVersion6 ? 6 : d.ieIsVersion7 ? 7 : d.ieIsVersion8 ? 8 : d.ieIsVersion9 ? 9 : d.ieIsVersion10 ? 10 : d.ieIsVersion11 ? 11 : d.ieIsAboveVersion11 ? 12 : 0,
standards: d.standardsCompliant,
detected: !d.isUndetected,
webkit: d.isWebKit
};
};
};

var defunctr = new Defunctr();

try {
Object.defineProperty(defunctr, 'detective', {
get: function get$$1() {
try {
var warn = logger && logger.warn ? logger.warn : logger.log;
warn('defunctr.detective is deprecated and will be removed in 2.0. Please use window.browser instead.');
} catch (oe) {
}
return new Detective();
},
enumerable: true,
configurable: true
});
} catch (ex) {
defunctr.detective = new Detective();
}

if (browserWindow) {
tagger(new Detective()).tag();

browserWindow.defunctr = defunctr;
try {
Object.defineProperty(browserWindow, 'Defunctr', {
get: function get$$1() {
logger.warn('window.Defunctr is deprecated and will be removed. Please use window.defunctr');
try {
var warn = logger && logger.warn ? logger.warn : logger.log;
warn('window.Defunctr is deprecated and will be removed in 2.0. Please use window.defunctr instead.');
} catch (oe) {
}
return defunctr;
},
enumerable: true,
Expand Down
6 changes: 3 additions & 3 deletions dist/defunctr.js

Large diffs are not rendered by default.

62 changes: 46 additions & 16 deletions dist/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*!
* Defunctr 1.3.0
* Defunctr 1.3.1
* https://github.com/cinecove/defunctr
*
* Copyright 2012 - 2017 Cinecove Digital, LLC and other contributors
* Released under the MIT license
* https://github.com/cinecove/defunctr/blob/master/LICENSE.md
*
* Build Date: 2017-02-10T07:58:02.681Z
* Build Date: 2017-08-14T02:37:48.958Z
*/
var browserWindow = window || null;
var browserDocument = browserWindow ? browserWindow.document || null : null;
Expand All @@ -16,12 +16,12 @@ var noop = function noop() {};
var console = browserWindow && browserWindow.console ? browserWindow.console : undefined;
var log = console ? console.log || noop : noop;
var warn = console ? console.warn || log : noop;
var error$1 = console ? console.error || log : noop;
var error = console ? console.error || log : noop;

var logger = {
log: log,
warn: warn,
error: error$1
error: error
};

var htmlElementConstructorCheck = function () {
Expand Down Expand Up @@ -61,8 +61,16 @@ var firefox = function () {
return installTriggerCheck();
};

var operaVersionCheck = function () {
return Boolean(browserWindow && browserWindow.opera && browserWindow.opera.version !== undef);
};

var opera = function () {
return operaVersionCheck();
};

var webkit = function () {
return webKitTransformCheck() && msWriteProfilerMarkCheck() === false && !firefox();
return webKitTransformCheck() && msWriteProfilerMarkCheck() === false && !firefox() && !opera();
};

var chrome = function () {
Expand All @@ -89,14 +97,6 @@ var khtml = function () {
return khtmlMarqueeCheck() && !safari();
};

var operaVersionCheck = function () {
return Boolean(browserWindow && browserWindow.opera && browserWindow.opera.version !== undef);
};

var opera = function () {
return operaVersionCheck();
};



var ie = function () {
Expand Down Expand Up @@ -485,20 +485,50 @@ var tagger = function (detective) {
var Defunctr = function Defunctr() {
classCallCheck(this, Defunctr);

this.version = '1.3.0';
this.detective = new Detective();
this.version = '1.3.1';
this.browser = function browser() {
var d = new Detective();
return {
vendor: d.isChrome ? 'chrome' : d.isEdge ? 'edge' : d.isFirefox ? 'firefox' : d.isIE ? 'ie' : d.isKhtml ? 'khtml' : d.isOpera && d.isOperaNext ? 'opera' : d.isSafari ? 'safari' : 'unknown',
version: !d.isIE ? 0 : d.ieIsBelowVersion6 ? 5 : d.ieIsVersion6 ? 6 : d.ieIsVersion7 ? 7 : d.ieIsVersion8 ? 8 : d.ieIsVersion9 ? 9 : d.ieIsVersion10 ? 10 : d.ieIsVersion11 ? 11 : d.ieIsAboveVersion11 ? 12 : 0,
standards: d.standardsCompliant,
detected: !d.isUndetected,
webkit: d.isWebKit
};
};
};

var defunctr = new Defunctr();

try {
Object.defineProperty(defunctr, 'detective', {
get: function get$$1() {
try {
var warn = logger && logger.warn ? logger.warn : logger.log;
warn('defunctr.detective is deprecated and will be removed in 2.0. Please use window.browser instead.');
} catch (oe) {
}
return new Detective();
},
enumerable: true,
configurable: true
});
} catch (ex) {
defunctr.detective = new Detective();
}

if (browserWindow) {
tagger(new Detective()).tag();

browserWindow.defunctr = defunctr;
try {
Object.defineProperty(browserWindow, 'Defunctr', {
get: function get$$1() {
logger.warn('window.Defunctr is deprecated and will be removed. Please use window.defunctr');
try {
var warn = logger && logger.warn ? logger.warn : logger.log;
warn('window.Defunctr is deprecated and will be removed in 2.0. Please use window.defunctr instead.');
} catch (oe) {
}
return defunctr;
},
enumerable: true,
Expand Down
62 changes: 46 additions & 16 deletions docs/scripts/defunctr.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*!
* Defunctr 1.3.0
* Defunctr 1.3.1
* https://github.com/cinecove/defunctr
*
* Copyright 2012 - 2017 Cinecove Digital, LLC and other contributors
* Released under the MIT license
* https://github.com/cinecove/defunctr/blob/master/LICENSE.md
*
* Build Date: 2017-02-10T07:58:02.681Z
* Build Date: 2017-08-14T02:37:48.958Z
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
Expand All @@ -22,12 +22,12 @@ var noop = function noop() {};
var console = browserWindow && browserWindow.console ? browserWindow.console : undefined;
var log = console ? console.log || noop : noop;
var warn = console ? console.warn || log : noop;
var error$1 = console ? console.error || log : noop;
var error = console ? console.error || log : noop;

var logger = {
log: log,
warn: warn,
error: error$1
error: error
};

var htmlElementConstructorCheck = function () {
Expand Down Expand Up @@ -67,8 +67,16 @@ var firefox = function () {
return installTriggerCheck();
};

var operaVersionCheck = function () {
return Boolean(browserWindow && browserWindow.opera && browserWindow.opera.version !== undef);
};

var opera = function () {
return operaVersionCheck();
};

var webkit = function () {
return webKitTransformCheck() && msWriteProfilerMarkCheck() === false && !firefox();
return webKitTransformCheck() && msWriteProfilerMarkCheck() === false && !firefox() && !opera();
};

var chrome = function () {
Expand All @@ -95,14 +103,6 @@ var khtml = function () {
return khtmlMarqueeCheck() && !safari();
};

var operaVersionCheck = function () {
return Boolean(browserWindow && browserWindow.opera && browserWindow.opera.version !== undef);
};

var opera = function () {
return operaVersionCheck();
};



var ie = function () {
Expand Down Expand Up @@ -491,20 +491,50 @@ var tagger = function (detective) {
var Defunctr = function Defunctr() {
classCallCheck(this, Defunctr);

this.version = '1.3.0';
this.detective = new Detective();
this.version = '1.3.1';
this.browser = function browser() {
var d = new Detective();
return {
vendor: d.isChrome ? 'chrome' : d.isEdge ? 'edge' : d.isFirefox ? 'firefox' : d.isIE ? 'ie' : d.isKhtml ? 'khtml' : d.isOpera && d.isOperaNext ? 'opera' : d.isSafari ? 'safari' : 'unknown',
version: !d.isIE ? 0 : d.ieIsBelowVersion6 ? 5 : d.ieIsVersion6 ? 6 : d.ieIsVersion7 ? 7 : d.ieIsVersion8 ? 8 : d.ieIsVersion9 ? 9 : d.ieIsVersion10 ? 10 : d.ieIsVersion11 ? 11 : d.ieIsAboveVersion11 ? 12 : 0,
standards: d.standardsCompliant,
detected: !d.isUndetected,
webkit: d.isWebKit
};
};
};

var defunctr = new Defunctr();

try {
Object.defineProperty(defunctr, 'detective', {
get: function get$$1() {
try {
var warn = logger && logger.warn ? logger.warn : logger.log;
warn('defunctr.detective is deprecated and will be removed in 2.0. Please use window.browser instead.');
} catch (oe) {
}
return new Detective();
},
enumerable: true,
configurable: true
});
} catch (ex) {
defunctr.detective = new Detective();
}

if (browserWindow) {
tagger(new Detective()).tag();

browserWindow.defunctr = defunctr;
try {
Object.defineProperty(browserWindow, 'Defunctr', {
get: function get$$1() {
logger.warn('window.Defunctr is deprecated and will be removed. Please use window.defunctr');
try {
var warn = logger && logger.warn ? logger.warn : logger.log;
warn('window.Defunctr is deprecated and will be removed in 2.0. Please use window.defunctr instead.');
} catch (oe) {
}
return defunctr;
},
enumerable: true,
Expand Down
Binary file added nuget/Defunctr.1.3.1.nupkg
Binary file not shown.
Loading

2 comments on commit 5442738

@deavial
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

closes #134

@deavial
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

closes #133

Please sign in to comment.