Redirect Reddit to show new posts

This script will automatically redirect subreddits to show new posts

目前为 2020-05-23 提交的版本。查看 最新版本

// ==UserScript==
// @name        Redirect Reddit to show new posts
// @namespace   Violentmonkey Scripts
// @version     1.1
// @homepage    
// @description This script will automatically redirect subreddits to show new posts
// @include     https://reddit.com/r/*
// @include     https://www.reddit.com/r/*
// @author      Aar318
// @description Script to Redirect subreddits to show new posts - 5/16/2020, 12:47:17 PM
// @grant       none
// ==/UserScript==

  // Redirect Reddit to show new posts //

(function () {
"use strict";

const { pathname, origin, href } = window.location;

if (href.includes("/comments")) return; // comment this out to function again

if (!pathname.includes("/new"))
  window.location.href = `${origin}${pathname}${
    pathname.endsWith("/")
      ? ""
      : "/"
//  }embed?pub=true`;
  }new`; 
})();


setTimeout(function(){
  document.querySelector('button#LayoutSwitch--picker').click();
  console.log("Layout Switcher");
}, 500);

setTimeout(function(){
  document.querySelector('button._10K5i7NW6qcm-UoCtpB3aK._3LwUIE7yX7CZQKmD2L87vf._1F02c6Yw0dfhdWwl99UrYn._1oYEKCssGFjqxQ9jJMNj5G').click();  
  console.log("Classic View");
}, 800);

setTimeout(function(){
  document.querySelector('h1._2yYPPW47QxD4lFQTKpfpLQ').click();  
  console.log("Click off of Picker");
}, 1000);

//button._10K5i7NW6qcm-UoCtpB3aK._3LwUIE7yX7CZQKmD2L87vf._1F02c6Yw0dfhdWwl99UrYn._1oYEKCssGFjqxQ9jJMNj5G //classic
//button#LayoutSwitch--picker._10K5i7NW6qcm-UoCtpB3aK._3LwUIE7yX7CZQKmD2L87vf._1F02c6Yw0dfhdWwl99UrYn._1fiOgAxLiYfEU41C1NOX9B._1IKtbRloF_LV1hPqMzP3MC // picker

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址