Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Prevent 3rd party script to load ssr #19443

Open
wants to merge 4 commits into
base: epic/opf
Choose a base branch
from

Conversation

FollowTheFlo
Copy link
Contributor

prevent 3rd party JS to load in ssr
SSR only load 3rd party html as sanitized html thus cleaning any script and non-standard html tags. it also keeps the inline css.

@FollowTheFlo FollowTheFlo requested a review from a team as a code owner October 24, 2024 17:03
@@ -23,14 +24,26 @@ import { OpfCtaScriptsService } from '../opf-cta-scripts/opf-cta-scripts.service
export class OpfCtaElementComponent implements AfterViewInit {
protected sanitizer = inject(DomSanitizer);
protected opfCtaScriptsService = inject(OpfCtaScriptsService);
loader = true;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not used

}

// Removing script tags on FE until BE fix: CXSPA-8572
protected removeScriptTags(html: string) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This function can only be used in CSR as using DOMParser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant