Skip to content

Commit

Permalink
Re-enable full user agent detection
Browse files Browse the repository at this point in the history
Chrome would be recognized as mozilla, since its user
agent string tells us that it is mozilla compatible.
This lead to some wrong detections in ocbnet slider.
  • Loading branch information
mgreter committed Dec 12, 2015
1 parent e45f960 commit 67c5f57
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
11 changes: 6 additions & 5 deletions layout.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions layout.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
var ua = navigator.userAgent.toLowerCase();

// only match for ie and mozilla so far
var match = // /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
// /(webkit)[ \/]([\w.]+)/.exec( ua ) ||
// /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
/(webkit)[ \/]([\w.]+)/.exec( ua ) ||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
/(msie) ([\w.]+)/.exec( ua ) ||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
[];
Expand Down Expand Up @@ -199,6 +199,7 @@
var body_2nd_x = win.innerWidth();
var body_2nd_y = win.innerHeight();

// check if layout triggered any scrollbar changes
if (body_1st_x != body_2nd_x || body_1st_y != body_2nd_y)
// if (body_1st_x > body_2nd_x || body_1st_y > body_2nd_y)
{
Expand Down Expand Up @@ -259,6 +260,11 @@
};
// EO Manager

// expose ua info
Manager.ua = {
'browser': browser,
'version': version
};

// static global function
Manager.config = function (key, value)
Expand Down

0 comments on commit 67c5f57

Please sign in to comment.