Fluid Mastodon

Mastodon, taking all available width, assuming 3 columns (mastodon.technology, mastodon.social and w3c.social only; fork for other domains)

当前为 2018-10-22 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Fluid Mastodon
  3. // @description Mastodon, taking all available width, assuming 3 columns (mastodon.technology, mastodon.social and w3c.social only; fork for other domains)
  4. // @namespace https://tripu.info/
  5. // @version 0.3.2
  6. // @include http://mastodon.technology/*
  7. // @include https://mastodon.technology/*
  8. // @include http://mastodon.social/*
  9. // @include https://mastodon.social/*
  10. // @include http://w3c.social/*
  11. // @include https://w3c.social/*
  12. // @license MIT
  13. // @supportURL https://tripu.info/
  14. // @author tripu
  15. // ==/UserScript==
  16.  
  17. console.debug('[Fluid Mastodon] Start');
  18.  
  19. (() => {
  20. 'use strict';
  21. if (document && document.getElementsByTagName && document.createElement) {
  22. var head = document.getElementsByTagName('head');
  23. if (head && 1 === head.length) {
  24. const style = document.createElement('style');
  25. head = head[0];
  26. style.innerText = `
  27. .columns-area > .drawer,
  28. .columns-area > .column,
  29. .columns-area > .column__wrapper {
  30. width: 33%;
  31. }
  32. .columns-area > .column__wrapper > .column {
  33. width: 100%;
  34. }
  35. `;
  36. head.appendChild(style);
  37. console.debug('[Fluid Mastodon] ✓ Done');
  38. } else {
  39. console.debug('[Fluid Mastodon] ✗ No head');
  40. }
  41. } else {
  42. console.debug('[Fluid Mastodon] ✗ No document');
  43. }
  44. })();
  45.  
  46. console.debug('[Fluid Mastodon] End');