discourse/spec/lib/onebox/engine
Rafael dos Santos Silva 6096c3551b
FEATURE: Native Reddit embeds for oneboxes (#39162)
Reddit increasingly blocks server-side fetches from Discourse instances,
which makes the current Reddit onebox path unreliable. This switches
Reddit oneboxes to Reddit's native embed path instead of trying to fetch
and render post metadata on the server.

Changes:
- replace the Reddit onebox engine with a native `embed.reddit.com`
iframe
- listen for Reddit resize messages so embeds grow to the correct height
- remove the now-unused Reddit OAuth site settings and auth mixin
- update Reddit onebox specs and add a JS unit test for the resize
handler

Screenshots:
<img width="704" height="1861" alt="image"
src="https://github.com/user-attachments/assets/ce332dfb-c76b-4700-ab26-fae9123cbd8c"
/>
2026-04-09 11:56:22 -03:00
..
allowlisted_generic_onebox_spec.rb FIX: Switch Reddit onebox from OG scraping to JSON API (#38035) 2026-02-24 15:29:00 -03:00
amazon_onebox_spec.rb FIX: correctly unescape title for amazon oneboxes (#33010) 2025-06-02 17:50:13 +05:30
animated_image_onebox_spec.rb
asciinema_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
audio_com_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
audio_onebox_spec.rb
audioboom_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
bandcamp_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
cloud_app_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
coub_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
discourse_topic_onebox_spec.rb
facebook_media_onebox_spec.rb SECURITY: Fix Stored-dom XSS via Facebook Oneboxes 2024-07-03 20:49:22 +08:00
five_hundred_px_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
flickr_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
flickr_shortened_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
gfycat_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
github_actions_onebox_spec.rb FEATURE: Allow for multiple GitHub onebox tokens (#27887) 2024-07-15 13:07:36 +10:00
github_blob_onebox_spec.rb FEATURE: Allow for multiple GitHub onebox tokens (#27887) 2024-07-15 13:07:36 +10:00
github_commit_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
github_folder_onebox_spec.rb FIX: Better handling of github_folder onebox w/o opengraph tags (#39142) 2026-04-08 11:49:57 +02:00
github_gist_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
github_issue_onebox_spec.rb DEV: discourse-emojis gem (#31408) 2025-03-03 13:09:08 +01:00
github_pull_request_onebox_spec.rb FEATURE: Include PR number in the GitHub PR oneboxes (#37409) 2026-01-30 11:17:57 -08:00
github_repo_onebox_spec.rb DEV: code cleanup (#37809) 2026-02-13 11:55:53 +01:00
gitlab_blob_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
google_calendar_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
google_docs_onebox_spec.rb
google_drive_onebox_spec.rb
google_maps_onebox_spec.rb DEV: Fix various rubocop lints (#24749) 2023-12-06 23:25:00 +01:00
google_photos_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
google_play_app_onebox_spec.rb
hackernews_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
html_spec.rb
image_onebox_spec.rb FIX: Support Dropbox /scl/ URL format in video and image oneboxes (#38394) 2026-03-11 10:37:57 +01:00
imgur_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
instagram_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
json_spec.rb
kaltura_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
loom_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
mixcloud_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
motoko_onebox_spec.rb FIX: Update "Embed Motoko" Onebox URLs (#22198) 2023-07-26 09:41:01 +08:00
pastebin_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
pdf_onebox_spec.rb
pubmed_onebox_spec.rb
reddit_media_onebox_spec.rb FEATURE: Native Reddit embeds for oneboxes (#39162) 2026-04-09 11:56:22 -03:00
replit_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
simplecast_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
sketch_fab_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
slides_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
soundcloud_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
spotify_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
stack_exchange_onebox_spec.rb
standard_embed_spec.rb FIX: broken XPath escaping and undefined CSS constant in anchor lookup (#37546) 2026-02-05 17:59:35 +11:00
steam_store_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
threads_status_onebox_spec.rb FEATURE: Basic support for threads.net onebox (#22471) 2023-07-06 16:02:49 -03:00
tiktok_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
trello_onebox_spec.rb
twitch_clips_onebox_spec.rb FEATURE: Handle newer url format for Twitch clips (#31080) 2025-01-31 10:42:46 -03:00
twitch_stream_onebox_spec.rb Fix tests 2023-05-15 16:45:33 +02:00
twitch_video_onebox_spec.rb Fix tests 2023-05-15 16:45:33 +02:00
twitter_status_onebox_spec.rb FIX: Respect blocked_onebox_domains for Twitter/X and handle empty oneboxes (#38868) 2026-03-25 15:10:35 +01:00
typeform_onebox_spec.rb
video_onebox_spec.rb FIX: Support Dropbox /scl/ URL format in video and image oneboxes (#38394) 2026-03-11 10:37:57 +01:00
vimeo_onebox_spec.rb SECURITY: Restrict allowed URL patterns 2025-02-04 13:32:34 -03:00
wikimedia_onebox_spec.rb DEV: Use thumbnail url for wikimedia onebox image (#22620) 2023-07-14 12:20:18 -06:00
wikipedia_onebox_spec.rb FIX: Wikipedia onebox images and sections (#31384) 2025-02-19 14:29:17 +10:00
wistia_onebox_spec.rb
xkcd_spec.rb
youku_onebox_spec.rb
youtube_onebox_spec.rb FIX: Use oEmbed for YouTube oneboxing (#35959) 2025-11-12 14:13:16 +10:00