@a2f0/skyline 0.2.37 → 0.2.39

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a2f0/skyline",
3
- "version": "0.2.37",
3
+ "version": "0.2.39",
4
4
  "description": "Interactive Chicago skyline viewer and reusable Three.js building models",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -52,7 +52,7 @@
52
52
  }
53
53
  },
54
54
  "dependencies": {
55
- "@a2f0/ct-client": "0.1.0",
55
+ "@a2f0/ct-client": "0.1.2",
56
56
  "@types/three": "0.186.0"
57
57
  },
58
58
  "scripts": {
@@ -18,6 +18,6 @@ const routes = {
18
18
  };
19
19
  const route = routes[location.pathname];
20
20
  if (location.origin === "https://skyline.devopsrockstars.com" && route) {
21
- const tracker = createTracker({ site: "skyline", capture: "all", page: () => route });
21
+ const tracker = createTracker({ site: "skyline", capture: "all", overrideGpc: true, page: () => route });
22
22
  tracker.init();
23
23
  }
@@ -2,9 +2,9 @@
2
2
  var OPT_OUT_KEY = "ct:opt-out";
3
3
  var OPT_OUT_EVENT = "ct:opt-out-change";
4
4
  var EXTENSION_ATTRIBUTE = "data-ct-disabled";
5
- function optedOut() {
5
+ function optedOut(overrideGpc = false) {
6
6
  try {
7
- return navigator.webdriver === true || navigator.doNotTrack === "1" || navigator.globalPrivacyControl === true || document.documentElement?.hasAttribute(EXTENSION_ATTRIBUTE) === true || localStorage.getItem(OPT_OUT_KEY) === "1";
7
+ return navigator.webdriver === true || navigator.doNotTrack === "1" || !overrideGpc && navigator.globalPrivacyControl === true || document.documentElement?.hasAttribute(EXTENSION_ATTRIBUTE) === true || localStorage.getItem(OPT_OUT_KEY) === "1";
8
8
  } catch {
9
9
  return true;
10
10
  }
@@ -36,6 +36,7 @@ function createTracker(options) {
36
36
  const interval = bounded(options.flushIntervalMs, 5000, 100, 60000);
37
37
  const capacity = bounded(options.maxQueueSize, 500, batchSize, 1000);
38
38
  const endpoint = options.endpoint ?? "https://ct.a2f0.net/v1/clicks";
39
+ const overrideGpc = options.overrideGpc === true;
39
40
  let initialized = false;
40
41
  let disabled = false;
41
42
  let queue = [];
@@ -54,7 +55,7 @@ function createTracker(options) {
54
55
  request?.abort();
55
56
  }
56
57
  function blocked() {
57
- if (disabled || optedOut()) {
58
+ if (disabled || optedOut(overrideGpc)) {
58
59
  clear();
59
60
  return true;
60
61
  }