prettier fixes
This commit is contained in:
parent
ea26a03353
commit
97dfde8fa3
|
@ -1,22 +1,17 @@
|
||||||
const oldReddit = "https://old.reddit.com";
|
const oldReddit = "https://old.reddit.com";
|
||||||
const excludedPaths = [
|
const excludedPaths = ["/gallery", "/poll", "/rpan", "/settings", "/topics"];
|
||||||
"/gallery",
|
|
||||||
"/poll",
|
|
||||||
"/rpan",
|
|
||||||
"/settings",
|
|
||||||
"/topics"];
|
|
||||||
|
|
||||||
chrome.webRequest.onBeforeRequest.addListener(
|
chrome.webRequest.onBeforeRequest.addListener(
|
||||||
function(details) {
|
function (details) {
|
||||||
const url = new URL(details.url);
|
const url = new URL(details.url);
|
||||||
|
|
||||||
if (url.hostname === "old.reddit.com") return;
|
if (url.hostname === "old.reddit.com") return;
|
||||||
|
|
||||||
for (const path of excludedPaths) {
|
for (const path of excludedPaths) {
|
||||||
if (url.pathname.indexOf(path) === 0) return;
|
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: [
|
urls: [
|
||||||
|
@ -34,8 +29,8 @@ chrome.webRequest.onBeforeRequest.addListener(
|
||||||
"image",
|
"image",
|
||||||
"object",
|
"object",
|
||||||
"xmlhttprequest",
|
"xmlhttprequest",
|
||||||
"other"
|
"other",
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
["blocking"]
|
["blocking"]
|
||||||
);
|
);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"description": "Ensure Reddit always loads the old design",
|
"description": "Ensure Reddit always loads the old design",
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"background": {"scripts":["background.js"]},
|
"background": { "scripts": ["background.js"] },
|
||||||
"icons": {
|
"icons": {
|
||||||
"48": "img/icon48.png",
|
"48": "img/icon48.png",
|
||||||
"128": "img/icon128.png"
|
"128": "img/icon128.png"
|
||||||
|
|
Loading…
Reference in New Issue