Skip to content

Commit

Permalink
Add debug output for Osano (#17857)
Browse files Browse the repository at this point in the history
  • Loading branch information
timroes authored Oct 11, 2022
1 parent bd54de0 commit e2a5c37
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions airbyte-webapp/src/utils/dataPrivacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ declare global {
cm: {
mode: "production" | "debug";
showDrawer: (type: string) => void;
addEventListener: (event: string, callback: (event: unknown) => void) => void;
};
};
}
Expand Down Expand Up @@ -63,6 +64,14 @@ export const loadOsano = (): void => {
// Create and append the script tag to load osano
const script = document.createElement("script");
script.src = `https://cmp.osano.com/${process.env.REACT_APP_OSANO}/osano.js`;
script.addEventListener("load", () => {
window.Osano?.cm.addEventListener("osano-cm-script-blocked", (item) => {
console.debug(`Script blocked by Osano: ${item}`);
});
window.Osano?.cm.addEventListener("osano-cm-cookie-blocked", (item) => {
console.debug(`Cookie blocked by Osano: ${item}`);
});
});
document.head.appendChild(script);
};

Expand Down

0 comments on commit e2a5c37

Please sign in to comment.