From ad2c20ea395833f226a17a55ee84e25acec9e689 Mon Sep 17 00:00:00 2001 From: luxick Date: Fri, 28 Aug 2026 14:00:47 +0200 Subject: [PATCH] Also inline video comments --- js/reddit-image-inline.user.js | 75 +++++++++++++++++++++++++++++----- 1 file changed, 64 insertions(+), 11 deletions(-) diff --git a/js/reddit-image-inline.user.js b/js/reddit-image-inline.user.js index b87c54f..4de12bb 100644 --- a/js/reddit-image-inline.user.js +++ b/js/reddit-image-inline.user.js @@ -1,8 +1,8 @@ // ==UserScript== // @name Inline Reddit images and Comment Redirect // @namespace https://www.reddit.com -// @version 2025-09-24 -// @description Embed images posted as comments and redirect post links to comments +// @version 2026-08-28 +// @description Embed images and videos posted as comments and redirect post links to comments // @author luxick // @updateURL https://git.luxick.de/luxick/scripts/js/raw/branch/master/reddit-image-inline.user.js // @downloadURL https://git.luxick.de/luxick/scripts/js/raw/branch/master/reddit-image-inline.user.js @@ -15,18 +15,39 @@ (function() { 'use strict'; - // Handle image inlining - let xpath = "//a[text()='']"; - var element; - var result = document.evaluate(xpath, document, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null); - let links = []; - while(element = result.iterateNext()){ - if (element.href) { - links.push(element); + // Collect the placeholder links Reddit renders for media comments, + // e.g. "" or "