web-manager 3.2.9 → 3.2.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/lib/utilities.js +23 -0
  2. package/package.json +1 -1
package/lib/utilities.js CHANGED
@@ -95,4 +95,27 @@ Utilities.escapeHTML = function (str) {
95
95
  });
96
96
  }
97
97
 
98
+ Utilities.getContext = function () {
99
+ // Check mobile
100
+ function mobile() {
101
+ try {
102
+ var m = navigator.userAgentData.mobile;
103
+ return typeof m === 'undefined' ? _THROW : m === true;
104
+ } catch (e) {
105
+ try {
106
+ return window.matchMedia('only screen and (max-width: 760px)').matches
107
+ } catch (e) {
108
+ return false;
109
+ }
110
+ }
111
+ }
112
+
113
+ // Return findings
114
+ return {
115
+ client: {
116
+ mobile: mobile(),
117
+ },
118
+ }
119
+ }
120
+
98
121
  module.exports = Utilities;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-manager",
3
- "version": "3.2.9",
3
+ "version": "3.2.10",
4
4
  "description": "Easily access important variables such as the query string, current domain, and current page in a single object.",
5
5
  "main": "index.js",
6
6
  "scripts": {