Skip to content

Commit

Permalink
♿ [amp-consent] fix: amp-consent iframe title for accessibility (#40047)
Browse files Browse the repository at this point in the history
* fix: amp-consent iframe title for accesibility

* fix: title origin

* fix: lint issue

* fix: move setAttribute with other setAttributes

* fix: remove unnecessary title on iframe
  • Loading branch information
honzalo authored Sep 10, 2024
1 parent f370d15 commit 7cf605b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion extensions/amp-consent/0.1/amp-consent.js
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,6 @@ export class AmpConsent extends AMP.BaseElement {

// Set up the __tcfApiLocator window to signal postMessage support
const iframe = this.element.ownerDocument.createElement('iframe');
iframe.setAttribute('title', this.element.title || 'Consent Banner');
iframe.setAttribute('name', TCF_API_LOCATOR);
iframe.setAttribute('aria-hidden', 'true');
toggle(iframe, false);
Expand Down
1 change: 1 addition & 0 deletions extensions/amp-consent/0.1/consent-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ export class ConsentUI {
createPromptIframe_(promptUISrc) {
const iframe = this.parent_.ownerDocument.createElement('iframe');
const sandbox = this.getSandboxAttribute_(promptUISrc);
iframe.setAttribute('title', this.parent_.title || 'Consent Banner');
iframe.setAttribute('sandbox', sandbox);
iframe.setAttribute('allow', IFRAME_ALLOWED_PERMISSIONS.join('; '));
const {classList} = iframe;
Expand Down

0 comments on commit 7cf605b

Please sign in to comment.