fetlife_unfakepictures

replace the css image on fetlife by the true one, allowing you to download the picture.

  1. // ==UserScript==
  2. // @name fetlife_unfakepictures
  3. // @namespace bewam.free.fr/gm_scripts
  4. // @description replace the css image on fetlife by the true one, allowing you to download the picture.
  5. // @include https://fetlife.com/users/*/pictures/*
  6. // @version 0.2.2
  7. // @run-at document-end
  8. // ==/UserScript==
  9.  
  10. var fake = document.querySelector('.fake_img');
  11. if (fake) {
  12. var p = fake.parentNode;
  13. var img = document.createElement('img');
  14. var url = getComputedStyle(fake).getPropertyValue("background-image");
  15.  
  16. if( url && (m = url.match(/url\(.?(\b.*\b).?\)/)) && m.length > 1 ) {
  17. img.src = m[1];
  18.  
  19. if(img.src.length > 0) {
  20. img.height = fake.offsetHeight;
  21. img.width = fake.offsetWidth;
  22. fake.className = ''; // TODO: should be a replace()
  23. p.appendChild(img, fake);
  24. }
  25. }
  26. }