web-manager 3.2.58 → 3.2.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -470,7 +470,8 @@ Manager.prototype.init = function(configuration, callback) {
470
470
  // Load polyfills
471
471
  init_loadPolyfills(self, configuration, function() {
472
472
  self.properties.page.status.initializing = false;
473
- // self.properties.genericPromise = new Promise(resolve => { resolve() });
473
+
474
+ // set options
474
475
  var options_defaults = {
475
476
  // debug: {
476
477
  // environment: self.properties.meta.environment,
@@ -487,9 +488,6 @@ Manager.prototype.init = function(configuration, callback) {
487
488
  initChecks: {
488
489
  features: [], // an array of javascript and dom features to check for (NIY)
489
490
  },
490
- refreshNewVersion: {
491
- enabled: true,
492
- },
493
491
  auth: {
494
492
  state: 'default', // required, prohibited, default
495
493
  sends: {
@@ -497,6 +495,9 @@ Manager.prototype.init = function(configuration, callback) {
497
495
  prohibited: '/',
498
496
  },
499
497
  },
498
+ refreshNewVersion: {
499
+ enabled: true,
500
+ },
500
501
  exitPopup: {
501
502
  enabled: true,
502
503
  config: {
package/lib/account.js CHANGED
@@ -7,17 +7,26 @@ function Account(init) {
7
7
  self.properties = {};
8
8
  self.accountPageInitialized = false;
9
9
 
10
+ // Initialize libraries
10
11
  try {
11
12
  self.dom = init.dom || self.Manager.dom();
12
13
  self.utilities = init.utilities || self.Manager.utilities();
14
+ } catch (e) {
15
+ console.error('Failed to initialize libraries');
16
+ }
13
17
 
14
- var url = new URL(window.location.href);
18
+ // Initialize account page
19
+ try {
20
+ // If we're NOT in the browser, skip
21
+ if (typeof window !== 'undefined') {
22
+ var url = new URL(window.location.href);
15
23
 
16
- if (url.pathname.startsWith('/account')) {
17
- self.initializeAccountPage();
24
+ if (url.pathname.startsWith('/account')) {
25
+ self.initializeAccountPage();
26
+ }
18
27
  }
19
28
  } catch (e) {
20
- console.error('Failed to initialize libraries');
29
+ console.error('Failed to initialize account page');
21
30
  }
22
31
  }
23
32
 
package/lib/dom.js CHANGED
@@ -319,6 +319,13 @@ Dom.select = function(selector, options) {
319
319
  });
320
320
  }
321
321
 
322
+ Dom.onDocumentReady = function(fn) {
323
+ if (['complete', 'interactive'].includes(document.readyState)) {
324
+ fn();
325
+ } else {
326
+ document.addEventListener('DOMContentLoaded', fn);
327
+ }
328
+ }
322
329
 
323
330
  Dom.prototype.parent = function(selector) {
324
331
  var elsObj = Object.assign({}, this.elements);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-manager",
3
- "version": "3.2.58",
3
+ "version": "3.2.60",
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": {