web-manager 3.1.7 → 3.1.9

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/dom.js +10 -2
  2. package/package.json +1 -1
package/lib/dom.js CHANGED
@@ -252,8 +252,16 @@ Dom.prototype.exists = function() {
252
252
  Dom.loadScript = function(options, callback) {
253
253
  return new Promise(function(resolve, reject) {
254
254
  options = options || {};
255
- options.async = (typeof options.async === 'undefined') ? false : options.async;
256
- options.crossorigin = (typeof options.crossorigin === 'undefined') ? false : options.crossorigin;
255
+ options.async = typeof options.async === 'undefined' ? false : options.async;
256
+ options.crossorigin = typeof options.crossorigin === 'undefined' ? false : options.crossorigin;
257
+ options.cacheBreaker = typeof options.cacheBreaker === 'undefined' ? true : options.cacheBreaker;
258
+
259
+ if (options.cacheBreaker) {
260
+ options.src = new URL(options.src);
261
+ options.src.searchParams.set('cb', new Date().getTime());
262
+ options.src = options.src.toString();
263
+ }
264
+
257
265
  var s = document.createElement('script');
258
266
  s.src = options.src;
259
267
  s.async = options.async;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-manager",
3
- "version": "3.1.7",
3
+ "version": "3.1.9",
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": {