File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,19 @@ sheet.type = "text/css";
1212sheet . innerText = styles ;
1313document . head . appendChild ( sheet ) ;
1414
15+ const sections = location . pathname . split ( / (? ! ^ ) \/ / ) ;
16+ const loc = sections [ 0 ] ;
17+
18+ if ( [ "/media" ] . includes ( loc ) ) {
19+ const i = new URLSearchParams ( location . search ) . get ( "url" ) ;
20+ fetch ( i )
21+ . then ( ( response ) => response . blob ( ) )
22+ . then ( ( blob ) => {
23+ const objectURL = URL . createObjectURL ( blob ) ;
24+ location . href = objectURL ;
25+ } ) ;
26+ }
27+
1528// hide multi-reddits by default
1629setTimeout ( ( ) => {
1730 const customFeeds = document . querySelector (
@@ -43,7 +56,6 @@ const observer = new MutationObserver((mutations, _) => {
4356} ) ;
4457
4558observer . observe ( targetNode , config ) ;
46-
4759/**
4860 *
4961 */
@@ -53,8 +65,6 @@ function run_it(node = document) {
5365 return ;
5466 }
5567
56- const sections = location . pathname . split ( / (? ! ^ ) \/ / ) ;
57- const loc = sections [ 0 ] ;
5868 if ( [ "/user" , "/r" ] . includes ( loc ) ) {
5969 for ( const element of node . querySelectorAll ( "a" ) ) {
6070 const href = element . getAttribute ( "href" ) ;
You can’t perform that action at this time.
0 commit comments