Skip to content

Commit

Permalink
New option: data-ui-allow-in-embeds="off" to suppress UI within emb…
Browse files Browse the repository at this point in the history
…eds (#151)
  • Loading branch information
eligrey authored Nov 21, 2023
1 parent e6217cc commit 55e46e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/transcend-io/consent-manager-ui.git"
},
"homepage": "https://github.com/transcend-io/consent-manager-ui",
"version": "4.9.0",
"version": "4.10.0",
"license": "MIT",
"main": "build/ui",
"files": [
Expand Down
7 changes: 7 additions & 0 deletions src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ export const airgapPromise = new Promise<AirgapAPI>((resolve) => {
* Initialize the Consent Manager UI and Transcend API
*/
export const init = async (): Promise<void> => {
// handle embedding constraints
const suppressUIDueToEmbeddingConstraints =
// eslint-disable-next-line no-restricted-globals
settings.uiAllowInEmbeds === 'off' && self !== top;
if (suppressUIDueToEmbeddingConstraints) {
return;
}
try {
if (LOG_ENABLED) {
logger.tag('Transcend', () => {
Expand Down

1 comment on commit 55e46e4

@vercel
Copy link

@vercel vercel bot commented on 55e46e4 Nov 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.