Add user settings to control loading external content#3566
Open
wofferl wants to merge 1 commit intonextcloud:masterfrom
Open
Add user settings to control loading external content#3566wofferl wants to merge 1 commit intonextcloud:masterfrom
wofferl wants to merge 1 commit intonextcloud:masterfrom
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces user-configurable frontend settings to control whether external media (enclosure thumbnails/images and images/iframes inside article bodies) is loaded automatically, shown behind a consent button, or removed.
Changes:
- Add new media-related enums and a
mediaOptionsstate/getter/mutation, initialized from server-provided initial state. - Extend the settings dialog with new radio groups to configure media loading behavior.
- Update feed item rendering to (a) gate images/iframes behind consent UI and (b) set
preload="none"for audio/video.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
tests/javascript/unit/components/routes/Explore.spec.ts |
Mock loadState for stable explore route unit tests. |
tests/javascript/unit/components/modals/AppSettings.spec.ts |
Add unit tests for new media settings controls. |
tests/javascript/unit/components/feed-display/FeedItemDisplay.spec.ts |
Add extensive unit tests for media gating/consent behavior and sanitization. |
src/store/app.ts |
Add mediaOptions to app state and initialize from initial state. |
src/enums/index.ts |
Introduce SHOW_MEDIA and MEDIA_TYPE enums. |
src/components/modals/AppSettingsDialog.vue |
Add “Media” settings section and persistence via mediaOptions. |
src/components/feed-display/FeedItemDisplay.vue |
Implement consent gating + sanitization of body HTML and enclosure rendering changes. |
src/components/ContentTemplate.vue |
Force FeedItemDisplay remount on item index changes (reset consent state). |
lib/Controller/PageController.php |
Provide initial state for mediaOptions from user config with defaults. |
CHANGELOG.md |
Add unreleased entries for the new settings and Media RSS image support. |
tests/javascript/unit/components/feed-display/FeedItemDisplay.spec.ts
Outdated
Show resolved
Hide resolved
tests/javascript/unit/components/feed-display/FeedItemDisplay.spec.ts
Outdated
Show resolved
Hide resolved
dfcda4c to
a620185
Compare
Signed-off-by: Wolfgang <github@linux-dude.de>
a620185 to
fd2ebed
Compare
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.
Summary
This PR adds settings to the web frontend to control loading external media.
It generally sets preload="none" on video and audio found in the article body.
Images are controlled with the settings and this can be show always, replace media with consent button or remove it at all.
Note:
This PR also added support for MRSS images, which are currently not shown. There can be redundancy with images from body or thumbnails and I disabled them generally if fulltext is enabled for the feed.
Thumbnails are now only displayed when media:content is audio or unknown mime type.
The default for theses images could also be set to 'never', so there is no change to the current state and users need to enable MRSS images by themselves.
Here an example of the consent buttons. It contains the domain and when an alt or title attribute is given a description. The type of media (img, iframe, etc) is shown in the button title.
These are the user settings:
Checklist