@blotoutio/edgetag-sdk-browser 0.36.2 → 0.37.0

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.
Files changed (2) hide show
  1. package/index.js +5 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -27,7 +27,8 @@
27
27
  let referrer = '';
28
28
  try {
29
29
  const referrerUrl = new URL(document.referrer);
30
- if (referrerUrl.host !== window.location.host) {
30
+ const pageUrl = new URL(getPageUrl());
31
+ if (referrerUrl.host !== pageUrl.host) {
31
32
  referrer = referrerUrl.href;
32
33
  }
33
34
  return referrer;
@@ -49,7 +50,7 @@
49
50
  };
50
51
  const getSearch = () => {
51
52
  try {
52
- return window.location.search;
53
+ return new URL(getPageUrl()).search;
53
54
  }
54
55
  catch {
55
56
  return '';
@@ -363,7 +364,7 @@
363
364
  referrer: getReferrer(),
364
365
  search: getSearch(),
365
366
  locale: getLocale(),
366
- sdkVersion: "0.36.2" ,
367
+ sdkVersion: "0.37.0" ,
367
368
  ...(payload || {}),
368
369
  };
369
370
  let storage = {};
@@ -839,7 +840,7 @@
839
840
  catch {
840
841
  return;
841
842
  }
842
- const params = new URLSearchParams(window.location.search);
843
+ const params = new URLSearchParams(getSearch());
843
844
  if (!params || !params.get(key)) {
844
845
  return;
845
846
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blotoutio/edgetag-sdk-browser",
3
- "version": "0.36.2",
3
+ "version": "0.37.0",
4
4
  "description": "Browser SDK for EdgeTag",
5
5
  "author": "Blotout",
6
6
  "license": "MIT",