🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

liteoverflow

remove all unrelated elements of stackoverflow

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

You will need to install an extension such as Tampermonkey to install this script.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

// ==UserScript==
// @description             remove all unrelated elements of stackoverflow
// @name                    liteoverflow
// @namespace               https://github.com/kevin335200/liteoverflow
// @version                 1.01
// @grant                   none
// @include                 http*://stackoverflow.com/*
// @author                  kevin335200
// @run-at document-end
// ==/UserScript==

// CSS Wide Screen
function addGlobalStyle(css) {
  var head, style;
  head = document.getElementsByTagName("head")[0];
  if (!head) {
    return;
  }
  style = document.createElement("style");
  style.type = "text/css";
  style.innerHTML = css;
  head.appendChild(style);
}

addGlobalStyle("#mainbar, .mainbar{width: calc(100%) ! important;}");
addGlobalStyle(
  "#content{max-width: 2000px ! important; width: calc(100%) ! important;}"
);

function turnoff_class(className) {
  let ele = document.getElementsByClassName(className);

  while (ele[0]) {
    ele[0].parentNode.removeChild(ele[0]);
  }
}

function turnoff_id(id) {
  let ele = document.getElementById(id);
  ele.parentNode.removeChild(ele);
}

async function hide_query(query) {
  let ele = document.querySelector(query);
  while (ele[0]) {
    ele[0].parentNode.removeChild(ele[0]);
  }
}

function hide_class(className) {
  let ele = document.getElementsByClassName(className);
  let n = ele.length;

  for (var i = 0; i < n; i++) {
    ele[i].style.display = "none";
  }
}

// "Products" Button
turnoff_class("list-reset grid gs4");
turnoff_class("-marketing-link js-gps-track js-products-menu");

// Left Sidebar
turnoff_class("left-sidebar");

turnoff_class("module sidebar-related");

// Feed
turnoff_class("js-feed-link");

// User Infos (edited time, gravatar, etc)
// turnoff_class("user-action-time");
// turnoff_class("user-gravatar32");

// Edit Button
turnoff_class("s-btn s-btn__link js-error-click js-gps-track");
turnoff_class("js-suggest-edit-post js-gps-track");

// Follow Button
turnoff_class(
  "s-btn s-btn__link js-follow-post js-follow-question js-gps-track"
);
turnoff_class("s-btn s-btn__link js-follow-post js-follow-answer js-gps-track");

// Comment Button
turnoff_class("js-add-link comments-link disabled-link");

// Vote Button
turnoff_class("js-vote-up-btn grid--cell s-btn s-btn__unset c-pointer");
turnoff_class("js-vote-down-btn grid--cell s-btn s-btn__unset c-pointer");

// Ask Button
turnoff_class("ws-nowrap s-btn s-btn__primary");

// The Overflow Blog
turnoff_class("s-sidebarwidget__yellow");

// Linked Questions
turnoff_class("sidebar-linked");

// Bottom Notice
turnoff_class("bottom-notice");

// Footer
turnoff_class("site-footer js-footer");

// Hot Questions
turnoff_id("hot-network-questions");

// Love This Site
turnoff_class("s-sidebarwidget--header");

// Newspaper
turnoff_class("s-sidebarwidget--content d-block");

// Chat Room
turnoff_class(
  "s-sidebarwidget--content s-sidebarwidget__items js-chat-ad-rooms"
);

// Markdown Editor
hide_class("post-form");
hide_class("no-answers");

// Survey Banner
turnoff_class("grid jc-space-between wmx12 mx-auto px16 py8");
turnoff_class("js-announcement-banner bg-black-700 fc-white ff-sans fs-body2 py2");

// Sign Up Bottom Bar
turnoff_class("grid wmx12 mx-auto px8 py12 jc-space-between ai-center lg:pl24 lg:pr24 md:fd-column sm:fd-row sm:ai-center")