FL Direct Link

Add a Direct Link to FL

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        FL Direct Link
// @namespace   https://fetlife.com/*
// @description Add a Direct Link to FL
// @include     https://fetlife.com/users/*/pictures/*
// @version     1
// @grant       none
// ==/UserScript==

var img = document.querySelector('img.fl-picture__img.fl-disable-interaction');
var imgUrl = img.getAttribute("src");
var sideBarSection = document.querySelector('aside.fl-content-sidebar section');
var linkElement = document.createElement('a');
var label = document.createTextNode('Open photo in new tab »');
linkElement.appendChild(label);
linkElement.setAttribute('target', '_blank');
linkElement.setAttribute('href', imgUrl);

var linkContainer = document.createElement('div');
linkContainer.style["text-align"] = "center";
linkContainer.appendChild(linkElement);

sideBarSection.appendChild(linkContainer);