diff --git a/background.js b/background.js index a1e4115..e38bf9a 100644 --- a/background.js +++ b/background.js @@ -1,5 +1,11 @@ const oldReddit = "https://old.reddit.com"; -const excludedPaths = ["/gallery", "/poll", "/rpan", "/settings", "/topics", "/community-points"]; +const excludedPaths = [ + "/poll", + "/rpan", + "/settings", + "/topics", + "/community-points", +]; chrome.webRequest.onBeforeRequest.addListener( function (details) { @@ -11,6 +17,10 @@ chrome.webRequest.onBeforeRequest.addListener( if (url.pathname.indexOf(path) === 0) return; } + if (url.pathname.indexOf("/gallery") === 0) { + return { redirectUrl: oldReddit + url.pathname.slice("/gallery".length) }; + } + return { redirectUrl: oldReddit + url.pathname + url.search + url.hash }; }, { diff --git a/manifest.json b/manifest.json index f3cdc2b..181d060 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "name": "Old Reddit Redirect", "description": "Ensure Reddit always loads the old design", - "version": "1.5.1", + "version": "1.6.0", "manifest_version": 2, "background": { "scripts": ["background.js"] }, "icons": {