StackExchange Tweaks

Minor visual tweaks to StackExchange (remove the new sidebar from Q/A pages)

As of 2018-07-07. See the latest version.

  1. // ==UserScript==
  2. // @name StackExchange Tweaks
  3. // @namespace SET
  4. // @description Minor visual tweaks to StackExchange (remove the new sidebar from Q/A pages)
  5. // @version 1.0.4
  6. // @license MIT
  7. // @include https://stackoverflow.com/*
  8. // @include https://superuser.com/*
  9. // @include https://serverfault.com/*
  10. // @include https://*.stackexchange.com/*
  11. // @grant GM_addStyle
  12. // ==/UserScript==
  13.  
  14. // Swap the positions of the notifications block and the username/stats block
  15. //var secondaryNav = document.querySelector('.secondary-nav')
  16. //secondaryNav.parentNode.insertBefore(secondaryNav, secondaryNav.parentNode.firstChild)
  17. var profileElementInner = document.querySelector('.my-profile');
  18. if (profileElementInner) {
  19. var profileElementContainer = profileElementInner.parentNode;
  20. profileElementContainer.parentNode.appendChild(profileElementContainer);
  21. } else {
  22. console.warn("Could not find .my-profile element");
  23. }
  24.  
  25. // Hide the sidebar when we are on question pages (to reduce visual noise)
  26. if (document.location.pathname.match(/^\/(q|questions)\//)) {
  27. GM_addStyle('#left-sidebar { display: none; }');
  28. }