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.31
  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. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. function MBasicStyleSheet(css) {
  15. var head, style;
  16. head = document.getElementsByTagName('head')[0];
  17. if (!head) { return; }
  18. style = document.createElement('style');
  19. style.type = 'text/css';
  20. style.innerHTML = css;
  21. head.appendChild(style);
  22. }
  23.  
  24. MBasicStyleSheet('img.basicIMG {height: auto;width: 100%;}')
  25.  
  26. var GET = document.getElementById('root').children[0].children[0].children[0].children[0].children[0].children[0].children[0];
  27. GET.classList.add("basicIMG");
  28. var GET2 = GET.children[0];
  29. GET2.classList.add("basicIMG");
  30. var GET3 = GET2.children[0];
  31. GET3.classList.add("basicIMG");
  32. var GET4 = GET3.children[0];
  33. GET4.classList.add("basicIMG");
  34. var GET5 = GET4.children[0];
  35. GET5.classList.add("basicIMG");
  36. var GET6 = GET5.children[0];
  37. GET6.classList.add("basicIMG");
  38. var GET7 = GET6.children[0];
  39. GET7.classList.add("basicIMG");
  40. var GET8 = GET7.children[0];
  41. GET8.classList.add("basicIMG");
  42. var GET9 = GET8.children[0];
  43. GET9.classList.add("basicIMG");
  44.  
  45. // var IMG = document.getElementById('MPhotoContent').children[0].children[1].children[0].children[0].children[1].children[2].href;
  46. })();