@telepath-computer/television-desktop 0.1.183 → 0.1.184
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.
|
@@ -61,6 +61,15 @@ window.addEventListener("pageshow", (event) => {
|
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
63
|
postInitialBridgeReady();
|
|
64
|
+
function testArtifactPollCadence() {
|
|
65
|
+
if (process.env.TV_TEST_MODE !== "true") return null;
|
|
66
|
+
const normalMs = Number(process.env.TV_TEST_ARTIFACT_POLL_NORMAL_MS);
|
|
67
|
+
const slowMs = Number(process.env.TV_TEST_ARTIFACT_POLL_SLOW_MS);
|
|
68
|
+
if (!Number.isFinite(normalMs) || normalMs <= 0 || !Number.isFinite(slowMs) || slowMs < normalMs) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
return { normalMs, slowMs };
|
|
72
|
+
}
|
|
64
73
|
function startProxyContentPoll() {
|
|
65
74
|
const capturedURL = window.location.href;
|
|
66
75
|
const isTvArtifactURL = (url) => {
|
|
@@ -72,8 +81,11 @@ function startProxyContentPoll() {
|
|
|
72
81
|
}
|
|
73
82
|
};
|
|
74
83
|
if (!isTvArtifactURL(capturedURL) || typeof window.fetch !== "function") return;
|
|
75
|
-
const
|
|
76
|
-
const
|
|
84
|
+
const PRODUCTION_NORMAL_POLL_MS = 5e3;
|
|
85
|
+
const PRODUCTION_SLOW_POLL_MS = 15e3;
|
|
86
|
+
const cadence = testArtifactPollCadence();
|
|
87
|
+
const NORMAL_POLL_MS = cadence?.normalMs ?? PRODUCTION_NORMAL_POLL_MS;
|
|
88
|
+
const SLOW_POLL_MS = cadence?.slowMs ?? PRODUCTION_SLOW_POLL_MS;
|
|
77
89
|
let baselineETag = null;
|
|
78
90
|
let delayMs = NORMAL_POLL_MS;
|
|
79
91
|
let stopped = false;
|