redditmod2

Dark themes, inline posts/comments, endless scrolling, subreddit filters, and other improvements for reddit.com

Old: v2.2.2 - 2020-05-22 - v2.2.2: Added support for redgifs
New: v2.2.3 - 2023-07-14 - 2.2.3: Fix for changes in media provider (thanks to Fistuoso).

  • --- /tmp/diffy20250908-2564035-5jtblp 2025-09-08 12:05:15.319228325 +0000
  • +++ /tmp/diffy20250908-2564035-vh7efh 2025-09-08 12:05:15.320228344 +0000
  • @@ -4,7 +4,7 @@
  • // @description Dark themes, inline posts/comments, endless scrolling, subreddit filters, and other improvements for reddit.com
  • // @include http://*.reddit.com/*
  • // @include https://*.reddit.com/*
  • -// @version 2.2.2
  • +// @version 2.2.3
  • // @grant GM.getValue
  • // @grant GM.setValue
  • // @grant GM.xmlHttpRequest
  • @@ -827,16 +827,18 @@
  • }
  • function RedgifsPromise(url) {
  • + debug('RedgifsPromise(url);', url);
  • return new Promise((resolve, reject) => {
  • let redgifsUrl = url.href;
  • _getDocument(redgifsUrl, {}, true)
  • .then(doc => {
  • - let video = doc.querySelector('video[id]');
  • - let source = video.querySelector('source');
  • + let source = doc.querySelector('meta[property="og:video"]');
  • + debug('[RedgifsPromise] source =', source);
  • if (!source) {
  • reject('[RedgifsPromise] Could not find video at ' + redgifsUrl + ' body: ' + doc.innerHTML);
  • } else {
  • - GenericVideoPromise([source.src]).then(resolve);
  • + debug('[RedgifPromise] source.content =', source.content);
  • + GenericVideoPromise([source.content]).then(resolve);
  • }
  • })
  • .catch(reject);