@blotoutio/edgetag-sdk-js 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.
package/index.cjs.js CHANGED
@@ -26,7 +26,8 @@ const getReferrer = () => {
26
26
  let referrer = '';
27
27
  try {
28
28
  const referrerUrl = new URL(document.referrer);
29
- if (referrerUrl.host !== window.location.host) {
29
+ const pageUrl = new URL(getPageUrl());
30
+ if (referrerUrl.host !== pageUrl.host) {
30
31
  referrer = referrerUrl.href;
31
32
  }
32
33
  return referrer;
@@ -48,7 +49,7 @@ const getPageUrl = () => {
48
49
  };
49
50
  const getSearch = () => {
50
51
  try {
51
- return window.location.search;
52
+ return new URL(getPageUrl()).search;
52
53
  }
53
54
  catch {
54
55
  return '';
@@ -362,7 +363,7 @@ const getStandardPayload = (payload) => {
362
363
  referrer: getReferrer(),
363
364
  search: getSearch(),
364
365
  locale: getLocale(),
365
- sdkVersion: "0.36.2" ,
366
+ sdkVersion: "0.37.0" ,
366
367
  ...(payload || {}),
367
368
  };
368
369
  let storage = {};
@@ -838,7 +839,7 @@ const handleCaptureQuery = (provider, key, persistType, map) => {
838
839
  catch {
839
840
  return;
840
841
  }
841
- const params = new URLSearchParams(window.location.search);
842
+ const params = new URLSearchParams(getSearch());
842
843
  if (!params || !params.get(key)) {
843
844
  return;
844
845
  }
package/index.mjs CHANGED
@@ -24,7 +24,8 @@ const getReferrer = () => {
24
24
  let referrer = '';
25
25
  try {
26
26
  const referrerUrl = new URL(document.referrer);
27
- if (referrerUrl.host !== window.location.host) {
27
+ const pageUrl = new URL(getPageUrl());
28
+ if (referrerUrl.host !== pageUrl.host) {
28
29
  referrer = referrerUrl.href;
29
30
  }
30
31
  return referrer;
@@ -46,7 +47,7 @@ const getPageUrl = () => {
46
47
  };
47
48
  const getSearch = () => {
48
49
  try {
49
- return window.location.search;
50
+ return new URL(getPageUrl()).search;
50
51
  }
51
52
  catch {
52
53
  return '';
@@ -360,7 +361,7 @@ const getStandardPayload = (payload) => {
360
361
  referrer: getReferrer(),
361
362
  search: getSearch(),
362
363
  locale: getLocale(),
363
- sdkVersion: "0.36.2" ,
364
+ sdkVersion: "0.37.0" ,
364
365
  ...(payload || {}),
365
366
  };
366
367
  let storage = {};
@@ -836,7 +837,7 @@ const handleCaptureQuery = (provider, key, persistType, map) => {
836
837
  catch {
837
838
  return;
838
839
  }
839
- const params = new URLSearchParams(window.location.search);
840
+ const params = new URLSearchParams(getSearch());
840
841
  if (!params || !params.get(key)) {
841
842
  return;
842
843
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blotoutio/edgetag-sdk-js",
3
- "version": "0.36.2",
3
+ "version": "0.37.0",
4
4
  "description": "JS SDK for EdgeTag",
5
5
  "author": "Blotout",
6
6
  "license": "MIT",