MBasic Facebook Image Resize

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

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

  1. // ==UserScript==
  2. // @name MBasic Facebook Image Resize
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.35
  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/photo.php*
  8. // @include https://free.facebook.com/photo.php*
  9. // @include  https://mbasic.facebook.com/*/photos/*
  10. // @include  https://free.facebook.com/*/photos/*
  11. // @include  https://mbasic.facebook.com/messages/attachment_preview/*
  12. // @include  https://free.facebook.com/messages/attachment_preview/*
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17.  
  18.  
  19. function MBasicStyleSheet(css) {
  20. var head, style;
  21. head = document.getElementsByTagName('head')[0];
  22. if (!head) { return; }
  23. style = document.createElement('style');
  24. style.type = 'text/css';
  25. style.innerHTML = css;
  26. head.appendChild(style);
  27. }
  28.  
  29. MBasicStyleSheet('img.basicIMG {height: auto;width: 100%;}')
  30.  
  31. var GET = document.getElementById('root').children[0].children[0].children[0].children[0].children[0].children[0].children[0];
  32. GET.classList.add("basicIMG");
  33. var GET2 = GET.children[0];
  34. GET2.classList.add("basicIMG");
  35. var GET3 = GET2.children[0];
  36. GET3.classList.add("basicIMG");
  37. var GET4 = GET3.children[0];
  38. GET4.classList.add("basicIMG");
  39. var GET5 = GET4.children[0];
  40. GET5.classList.add("basicIMG");
  41. var GET6 = GET5.children[0];
  42. GET6.classList.add("basicIMG");
  43. var GET7 = GET6.children[0];
  44. GET7.classList.add("basicIMG");
  45. var GET8 = GET7.children[0];
  46. GET8.classList.add("basicIMG");
  47. var GET9 = GET8.children[0];
  48. GET9.classList.add("basicIMG");
  49.  
  50.  
  51. // var IMG = document.getElementById('MPhotoContent').children[0].children[1].children[0].children[0].children[1].children[2].href;
  52. })();