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

How to customize the policy after defining the policy. #279

Open
zubairkhan1133 opened this issue Mar 29, 2023 · 0 comments
Open

How to customize the policy after defining the policy. #279

zubairkhan1133 opened this issue Mar 29, 2023 · 0 comments

Comments

@zubairkhan1133
Copy link

Hello,
I am using this library, I am stuck at one point. I want to know after defining the policy, how can I again customize it. Like I want to add more attributes and elements after defining it.
for e.g. the defined policy is
PolicyFactory POLICY_DEFINITION = new HtmlPolicyBuilder()
.allowAttributes(allowAttributesGlobally).globally()
.allowAttributes("src").onElements("img", "script", "iframe")
.allowAttributes("href").onElements("a")
.allowElements("a", "img", "script", "iframe")
.toFactory();

now I want to add 'link' attribute of 'body' tag and 'onload' attribute of 'a' tag. How can I add these after defining the policy

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

No branches or pull requests

1 participant