From 93e78faa984a9b3ef4a247591bf1a3ba9198b84d Mon Sep 17 00:00:00 2001 From: Tom Watson Date: Wed, 25 Apr 2018 16:43:21 +0200 Subject: [PATCH] initial commit --- .gitignore | 3 +++ LICENSE.txt | 21 +++++++++++++++++++++ README.md | 7 +++++++ background.js | 16 ++++++++++++++++ img/icon128.png | Bin 0 -> 7705 bytes img/icon48.png | Bin 0 -> 2574 bytes manifest.json | 17 +++++++++++++++++ 7 files changed, 64 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE.txt create mode 100644 README.md create mode 100644 background.js create mode 100644 img/icon128.png create mode 100644 img/icon48.png create mode 100644 manifest.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..602f681 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.swp +redirect.zip +.DS_Store diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..21379a2 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Tom Watson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..d0de1aa --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# Old Reddit Redirect + +Ensure Reddit always loads the old design + +## License + +Code copyright Tom Watson. Code released under [the MIT license](LICENSE.txt). diff --git a/background.js b/background.js new file mode 100644 index 0000000..984f312 --- /dev/null +++ b/background.js @@ -0,0 +1,16 @@ +const oldReddit = "http://old.reddit.com" + +chrome.webRequest.onBeforeRequest.addListener( + function(details) { + return {redirectUrl: oldReddit + details.url.match(/^https?:\/\/[^\/]+([\S\s]*)/)[1]} + }, + { + urls: [ + "*://reddit.com/*", + "*://www.reddit.com/*", + "*://np.reddit.com/*" + ], + types: ["main_frame", "sub_frame", "stylesheet", "script", "image", "object", "xmlhttprequest", "other"] + }, + ["blocking"] +) diff --git a/img/icon128.png b/img/icon128.png new file mode 100644 index 0000000000000000000000000000000000000000..e999360b85e738366a33b8ccbaec31712e343dd3 GIT binary patch literal 7705 zcmV+!9_HbRP)|U~L>Xuq| z7dE7_TdCxhJq}VFwSi5%3FY+?$A&cuF%B3jj@JdoFBl<&q8ICBJPf1JXnI;bJ@?1& zCrh#e=Fg20jse!K-3 zkl*(Jz4B`qhyndT9}smkVq7Zk%y9`YJp`-))&kY?s*ymb0-Sl?A^~&(Q3;Y(pdB~` zoOCo2p9er;CEO2G0@nkZfjY_TGQa~UHa~_ABu8n8Ge8q?SZa&-T+$GZIV9zEzy@F& za5WGBiY<_ED*!PBM1W(!uYlt~o1>BFJOJ`zd=;=&UN=fR?wsZCR0rOZVAv15;%Fp1 z4}k2M?gmx?cT2|CN#|`YQm^zIUIbo{T0xr!z~qd-4!8^0F1>drmj-Flar~Lo3MXa@ z5FE3B@hVUcd=a=EsO8cn9e4-W4eW9>a^_9D=s04&nC2N1D*qZ4)n}a z2AE$Dd<(c!hH~=+XMtV7la5B3FG&E% zSbhg^pY-yb^L!tt4UPei1N#e=VRRIT`BwtpmX4lpp4S(p81S^z25oa10MgOB0r-xL z>F1?Bdu^}>_y$F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jzd>o8B+Ko||hDJ{A3chdr~f Ty)Y;X00000NkvXXu0mjfcn_oQ literal 0 HcmV?d00001 diff --git a/img/icon48.png b/img/icon48.png new file mode 100644 index 0000000000000000000000000000000000000000..b1452a86cd4b80aa936f66c2c89d2b32a9775256 GIT binary patch literal 2574 zcmV+p3i0)cP)$+L$GIO<}ww?00Y3kfDmvTh&Y01 z3wgg|o|~3HJa0n6ub~o`%A;6#`$SGR~Osags z4A`q|K$Ub1!RcWYeYWT4seuPyg!;9RO~c215IG6w&jJP5u?PH3M%->`hhOe89KG6F zfyWC09w?^R(i_-iQl%)Rgm7Nr&oQ0Bk*Ur1j|mPWWO)ZcjKW{^_ia=WSV`Pg*VeYEcQ0Y0A(Ay+JX{EH*byWGu&9W2 z9sur~{2hRX;Qed`9Tzl)@)HzF<7LJ#L1AU1@%@D``hV-$?UnKX<8TSrZE(W{$9K;G2#h(aHO2Glki7SEWv!Q!=8?A!w&LPytFM zWHa^&cQ}qV9H+Mj5>ClZzhr%tI#bGD4+MZ$g_&`;T8Xn2QssMooefLn{4|8K3WS8w znRS^C#Pb^aqB^JZGbTtUu&oe4ilSn~I*Uk+d+VUJTA8~Oo*Gc|kh?tVKS|^@4h}(F zo6(6c0QIt{7@?dKJC{qAC{Er>^Q5xww;zI_QF^0ftA<6;-#>t zqHIu0kC$biYhvTJHYRFT@}CP)^pP|uPVhH^Z#B5wjE#=6sNi73VjXc6fnQP5qtYzE z?XA8Ue*8NlOG*W&u5o+YS=`6|O-5A0^40TVShvSRTl)@Dd5vS8?-+OBHnpR!LtTuX z{^KN6jTMS5jMhr?Dr`>73GKUK<5mOb07BwwSjVmPja<5PX+bj6?RL}F)6p1K6b-+?JnVZK-aTk=M=WgU{zvwL%QJm#CIv75 z)cAh@v3?^^3T@D;O2f zyxGXWrMA=u*WEC+RtWg)dZ=(QG&D5*^m7?FeGKwheC|qweGHtDX0P(*vQFeij8m~v zo4cMg;L>*t8e8Dr$H8eqY%ULc{~3et2YO-S7HHp%2K4s!PIo}pLDLX`U%?PO*7E77 zH2W`kQy|%NGP97p2+J)Lhrbbi_-muit*o-h!X-In_a9+=)Q}#Elc8voNF-8%>>TJ5 zNFnfvaXT30fL>vCi9afP1DOb36y17)AX$uY%7$ z3x|N1bOg}~0lI*@$|ki_@4`DTLHkb(?3dE%D~}nnV%tveF0)vpLV5_jb04vAABSqb zME8dwR8^gh{YWniCs`r|H+glWHGHx_&=EwN%pPw84+1UrC#S-JUmId;>kg2TbUIBu z9yeZG<%f>n!dv^Gt^s_jpt{a@mL5V+UL+Yk&#A#U{WVP_Jl)f`rt1(r2ZLu2=(Knh z8Wr0c?E$)qyAm<8KmUB$TSzD1PmdZE)>n5D3WeCefB)15oHs(^0`#8)H8ce&AwhAW zd27&D-iTgN5-StqaN#WUhd@(VwODeS52ST1paQQug2bmacg?oS-%AU7ORIFlmhBv= z+srGS?^$Q*Nv9?`-|l%f4UrJU2SC^GDuQpP{B|+;0vTW}X2E z!I8X|SH@OA?P^$3Q@$1`J@Mfr3`HRRu|b=FR}tJ(udt~~wZncI_>m*X8+M(!4&XL3 zpvwzAT{r0UVhS#V4QgCcZ6vHJ4^+6OnpE1j!TqCI%g19LEGM_BS@wY;3>1-Y?-wp)l{SRle##Cc_~4d7pxZy`m~_gB~sAhH8Ag&WxIUG zf#*u+1XpQTN03k<0fnlms>d7G3!PXQnz#M$E<0SZJx8j z{Jb0}n%=Yn51SL5Ycc2!0WSat?WU6RcA&_SHRerx$IRN!1#UcRYMa-AHzzafY|Sy> zw-y5U%@+4Iv(egU_L#&h@SOv~zzHA-bWLiTxte34_g?hLl~$k`*bJ=27||Ag+$Ig2 k0geK_rlyH4^y4=F1tO84QcrQWIRF3v07*qoM6N<$f`BB%(f|Me literal 0 HcmV?d00001 diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..4949c13 --- /dev/null +++ b/manifest.json @@ -0,0 +1,17 @@ +{ + "name": "Old Reddit Redirect", + "description": "Ensure Reddit always loads the old design", + "version": "1.0.0", + "manifest_version": 2, + "background": {"scripts":["background.js"]}, + "icons": { + "48": "img/icon48.png", + "128": "img/icon128.png" + }, + "permissions": [ + "webRequest", + "webRequestBlocking", + "*://reddit.com/*", + "*://www.reddit.com/*" + ] +}