FL Direct Link

Add a Direct Link to FL

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==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);