StackOverflow Distraction Blocker

Block distractions on StackExchange sites!

  1. // ==UserScript==
  2. // @name StackOverflow Distraction Blocker
  3. // @namespace https://stackoverflow.com/
  4. // @version 1.0
  5. // @description Block distractions on StackExchange sites!
  6. // @author Simon Baars
  7. // @match https://stackoverflow.com/*
  8. // @match *.stackexchange.com/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. var sidebar = document.getElementById("sidebar");
  16. if(sidebar != null)
  17. sidebar.parentElement.removeChild(sidebar);
  18.  
  19. var mainbar = document.getElementById("mainbar");
  20. if(mainbar != null)
  21. mainbar.style.width = "100%";
  22.  
  23. var answersBlock = document.getElementById("answers");
  24. if(answersBlock != null)
  25. answersBlock.style.width = "100%";
  26.  
  27. var answers = document.getElementsByClassName("answer");
  28. for(var i = 0; i<answers.length; i++){
  29. answers[i].style.width = "100%";
  30. }
  31.  
  32. var topBar = document.getElementsByTagName("header")[0];
  33. topBar.parentElement.removeChild(topBar);
  34.  
  35. document.getElementsByClassName("container")[0].style.maxWidth = "100%";
  36. document.getElementById("content").style.maxWidth = "100%";
  37. document.getElementsByTagName("body")[0].style.paddingTop = "0px";
  38. })();

QingJ © 2025

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