Repository navigation
Conversation
The extension wrote its settings into its own directory (static/config.<user>.json and an executable static/config.<user>.js), so it failed with "Your config file is not writable" whenever the extensions folder is read-only for the web server, and generated a JavaScript file at runtime. - Store the word list and options with setUserConfiguration(); no file writes anywhere. Settings from an existing static/config.<user>.json are picked up automatically until they are saved once. - Pass the settings to the script through the js_vars hook (context.extensions['Word highlighter'].configuration) instead of a generated script file; keep window.WordHighlighterConf as a fallback. - Fix highlighting that intermittently did not start: the script is loaded async and could run before #stream was parsed; wait for DOMContentLoaded (and for the FreshRSS global context). - Escape the word list in the configure textarea. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Word highlighter writes its settings into its own directory (
static/config.<user>.json, plus a generatedstatic/config.<user>.jsthat is loaded as a script). When theextensions/folder is not writable by the web server — a common hardening setup, e.g. a read-only bind mount in Docker — the configure page shows "Your config file is not writable, please change the file permissions for …" and settings cannot be saved. Making that folder writable means letting the web process create executable JavaScript.Separately, highlighting sometimes did not start at all: the script is added with
appendScript()(async), so it can run before#streamhas been parsed;document.querySelector('#stream')then returnsnullandMark/MutationObserverthrow. Reloading the same page alternated between highlighted and not highlighted (more often in Chromium than in Safari).Changes (0.0.5)
setUserConfiguration(); nothing is written to disk anymore.static/config.<user>.jsonis read (read-only) until the settings are saved once.js_varshook (context.extensions['Word highlighter'].configuration) instead of a generated script file.window.WordHighlighterConfis still accepted as a fallback.freshrss:globalContextLoaded) and forDOMContentLoadedbefore looking up#stream.static/.gitignoreignores the legacy per-user files; README changelog and version updated.Testing
On FreshRSS 1.30.0 / PHP 8.4 (Docker), with a read-only extensions folder:
eslint,markdownlint-cli2andphpcspass on the extension. I could not run phpstan locally.🤖 Generated with Claude Code