-
Notifications
You must be signed in to change notification settings - Fork 22
Remove __riverUiBasePath and __riverUiAssetUrl global functions #382
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
Remove __riverUiBasePath and __riverUiAssetUrl global functions #382
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR eliminates Content Security Policy issues by replacing global JavaScript functions with a JSON configuration approach for path resolution. The change removes inline script execution while maintaining the same functionality for determining the application's base path.
- Remove global
__riverUiBasePathand__riverUiAssetUrlfunctions from index.html - Replace global function usage with a
getBasePath()function that reads from JSON config - Update changelog to document the CSP-related fix
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/App.tsx | Adds getBasePath() function to read base path from JSON config instead of global functions |
| public/index.html | Removes inline script defining global functions |
| CHANGELOG.md | Documents the removal of global functions for CSP compliance |
bgentry
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jmfederico! I think I'm going to have to test this locally to make sure all the scenarios work fine as that doesn't all have great coverage yet.
Meanwhile, could you please add yourself to the CLA? 🙏
|
Hi! Is there anyway I can help with making this PR move forward? |
bgentry
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for the delay on this! I was pretty heads down trying to get #379 and a whole bunch of supporting infra shipped.
This will go out in the next release shortly. Thank you so much for reporting and fixing!
Replace global function usage with config JSON approach to eliminate CSP issues. - Remove global function definitions from index.html - Update App.tsx to read basepath from config__json element - Remove global function type definitions from TypeScript types - Maintain backward compatibility by falling back to '/' if config unavailable This change eliminates Content Security Policy problems by removing the need for inline script execution while preserving all existing functionality.
Since we no longer have any global window functions, the Window interface extension is not needed anymore.
Document the removal of global functions that eliminates Content Security Policy issues in the Unreleased section.
e16998e to
06be292
Compare
Replace global function usage with config JSON approach to eliminate CSP issues.
This change eliminates Content Security Policy problems by removing the need for inline script execution while preserving all existing functionality.