FL Direct Link

Add a Direct Link to FL

  1. // ==UserScript==
  2. // @name FL Direct Link
  3. // @namespace https://fetlife.com/*
  4. // @description Add a Direct Link to FL
  5. // @include https://fetlife.com/users/*/pictures/*
  6. // @version 1
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10. var img = document.querySelector('img.fl-picture__img.fl-disable-interaction');
  11. var imgUrl = img.getAttribute("src");
  12. var sideBarSection = document.querySelector('aside.fl-content-sidebar section');
  13. var linkElement = document.createElement('a');
  14. var label = document.createTextNode('Open photo in new tab »');
  15. linkElement.appendChild(label);
  16. linkElement.setAttribute('target', '_blank');
  17. linkElement.setAttribute('href', imgUrl);
  18.  
  19. var linkContainer = document.createElement('div');
  20. linkContainer.style["text-align"] = "center";
  21. linkContainer.appendChild(linkElement);
  22.  
  23. sideBarSection.appendChild(linkContainer);