We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4da5840 commit f43f336Copy full SHA for f43f336
2 files changed
src/config.ts
@@ -19,7 +19,7 @@ declare global {
19
}
20
21
export function getTargetOrigin() {
22
- return window.__tbxConfig?.targetOrigin || "https://app.testbox.com";
+ return window.__tbxConfig?.targetOrigin || ".testbox.com";
23
24
25
export function getLogLevel() {
src/index.ts
@@ -28,10 +28,11 @@ export function startTestBox(config?: TestBoxConfig) {
28
29
30
window.addEventListener("message", (ev) => {
31
- if (!ev.origin.includes(".testbox.com")) {
+ const targetOrigin = getTargetOrigin();
32
+ if (!ev.origin.includes(targetOrigin)) {
33
info("target-mismatch", {
34
messageOrigin: ev.origin,
- targetOrigin: getTargetOrigin(),
35
+ targetOrigin: targetOrigin,
36
});
37
return;
38
0 commit comments