MBasic Facebook Image Resize

Resizes images to take up the full width and sets height to auto. Only for MBasic Facebook.

当前为 2020-04-18 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name MBasic Facebook Image Resize
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.3
  5. // @description Resizes images to take up the full width and sets height to auto. Only for MBasic Facebook.
  6. // @author NaeemBolchhi
  7. // @match https://mbasic.facebook.com/*
  8. // @include https://free.facebook.com/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. function MBasicStyleSheet(css) {
  16. var head, style;
  17. head = document.getElementsByTagName('head')[0];
  18. if (!head) { return; }
  19. style = document.createElement('style');
  20. style.type = 'text/css';
  21. style.innerHTML = css;
  22. head.appendChild(style);
  23. }
  24.  
  25. MBasicStyleSheet('img.basicIMG {height: auto;width: 100%;}')
  26.  
  27. var GET = document.getElementById('root').children[0].children[0].children[0].children[0].children[0].children[0].children[0];
  28. GET.classList.add("basicIMG");
  29. var GET2 = GET.children[0];
  30. GET2.classList.add("basicIMG");
  31. var GET3 = GET2.children[0];
  32. GET3.classList.add("basicIMG");
  33. var GET4 = GET3.children[0];
  34. GET4.classList.add("basicIMG");
  35. var GET5 = GET4.children[0];
  36. GET5.classList.add("basicIMG");
  37. var GET6 = GET5.children[0];
  38. GET6.classList.add("basicIMG");
  39. var GET7 = GET6.children[0];
  40. GET7.classList.add("basicIMG");
  41. var GET8 = GET7.children[0];
  42. GET8.classList.add("basicIMG");
  43. var GET9 = GET8.children[0];
  44. GET9.classList.add("basicIMG");
  45. })();