prettier fixes

This commit is contained in:
Tom Watson 2021-01-23 14:40:00 +01:00
parent ea26a03353
commit 97dfde8fa3
2 changed files with 9 additions and 14 deletions

View File

@ -1,22 +1,17 @@
const oldReddit = "https://old.reddit.com";
const excludedPaths = [
"/gallery",
"/poll",
"/rpan",
"/settings",
"/topics"];
const excludedPaths = ["/gallery", "/poll", "/rpan", "/settings", "/topics"];
chrome.webRequest.onBeforeRequest.addListener(
function(details) {
function (details) {
const url = new URL(details.url);
if (url.hostname === "old.reddit.com") return;
for (const path of excludedPaths) {
if (url.pathname.indexOf(path) === 0) return;
}
return {redirectUrl: oldReddit + url.pathname + url.search + url.hash};
return { redirectUrl: oldReddit + url.pathname + url.search + url.hash };
},
{
urls: [
@ -34,8 +29,8 @@ chrome.webRequest.onBeforeRequest.addListener(
"image",
"object",
"xmlhttprequest",
"other"
]
"other",
],
},
["blocking"]
);

View File

@ -3,7 +3,7 @@
"description": "Ensure Reddit always loads the old design",
"version": "1.2.0",
"manifest_version": 2,
"background": {"scripts":["background.js"]},
"background": { "scripts": ["background.js"] },
"icons": {
"48": "img/icon48.png",
"128": "img/icon128.png"