-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix some JS issues #11250
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 some JS issues #11250
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 addresses security vulnerabilities, updates dependencies, and fixes PWA configuration issues. The changes include fixing an XSS vulnerability in the barcode scanner, updating Jest and related testing dependencies to newer versions, and correcting the webpack configuration for proper PWA initialization.
- Fixed XSS vulnerability by validating returnTo parameter in BarcodeScanner component
- Updated Jest from 29.7.0 to 30.0.5 and other testing-related dependencies
- Removed problematic webpack library configuration that was preventing PWA functionality
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| openlibrary/components/BarcodeScanner.vue | Added URL validation to prevent XSS via returnTo parameter |
| package.json | Updated Jest, stylelint, and workbox dependencies; added dependency overrides |
| webpack.config.js | Removed library configuration that was interfering with PWA setup |
| openlibrary/plugins/openlibrary/js/SearchBar.js | Added getCurUrl() method for better testability |
| tests/unit/js/SearchBar.test.js | Refactored test to use stubbed method instead of mocking window.location |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Fixes:
Technical
Testing
Patch deployed for the security fix, and otherwise up on testing.
Before:

Screenshot
Stakeholders