-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
brave/brave-core
#32817Milestone
Description
Description
Saving a big script into Brave scriptlets will throw an error in settings.js
It breaks due to maximum stack exceeded error, as the code currently encodes utf8 string as uint8Array and then it is spread with ...chunks into String.fromCharCode, that will throw an error.
Issue in this line
String.fromCharCode(...chunk)
Solution should be something like this;
Steps to reproduce
- Activate Brave scriptlets in Brave browser following official instructions
- While on
brave://settings/shields/filtersurl, open the browser's developer tools to capture error. - Add or edit the scriptlet that has 613229 chars (You can get one from here, as an example)
- Both adding or updating won't work, and in the console you will see the same error message.
- Profit (Look at the console output for an error)
Actual result
Script is not saved.
Expected result
Script saves successfully
Reproduces how often
Easily reproduced
Brave version (brave://version info)
Brave 1.85.111 (Official Build) (arm64)
Chromium: 143.0.7499.40
Channel information
- release (stable)
- beta
- nightly
Reproducibility
- with Brave Shields disabled
- with Brave Rewards disabled
- in the latest version of Chrome
Miscellaneous information
No response
Reactions are currently unavailable