Skip to content

Conversation

bubanoid
Copy link

@bubanoid bubanoid commented Jun 8, 2025

I've replaced all instances of javascript:void(0) in href attributes with # within the Bootstrap 4 templates. Also, the instance of javascript:void(0) in the flask_admin/static/vendor/select2/select2.min.js was replaced with #. This change is part of the effort to make the package more Content Security Policy (CSP) compliant.

Existing JavaScript onclick handlers are preserved, and the use of # as the href value for links that primarily trigger JavaScript actions or serve as placeholders should not impact functionality.

I manually tested dropdowns, actions, and pagination and confirmed that they continue to work as expected. I also ran automated tests, and all tests passed.

Copy link
Contributor

Choose a reason for hiding this comment

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

what is this file's purpose?

Copy link
Contributor

Choose a reason for hiding this comment

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

It gets created/managed by the tests somehow - I think if tests fail in some ways it doesn't get cleaned up properly. Probably should be .gitignored.

Copy link
Author

@bubanoid bubanoid Jun 30, 2025

Choose a reason for hiding this comment

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

This file is an artifact from a previously failed test. All tests are passing now, so I don’t think we should add it to .gitignore - tests should pass before a PR is merged.

UPD
The file was removed.

bubanoid added 2 commits June 30, 2025 18:41
I've replaced all instances of `javascript:void(0)` in href attributes with `#` within the Bootstrap 4 templates. This change is part of the effort to make the package more Content Security Policy (CSP) compliant. Existing JavaScript `onclick` handlers are preserved, and the use of `#` as the href value for links that primarily trigger JavaScript actions or serve as placeholders should not impact functionality. I manually tested dropdowns, actions, and pagination and confirmed that they continue to work as expected. I also ran automated tests, and all tests passed.
@bubanoid bubanoid force-pushed the csp-compliance-javascript-void branch from b578421 to a4b94bc Compare June 30, 2025 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants