Skip to content

Instantly share code, notes, and snippets.

@IlyaGulya
Last active November 12, 2016 04:43
Show Gist options
  • Save IlyaGulya/11b9105b7fa30e34de70597409759277 to your computer and use it in GitHub Desktop.
Save IlyaGulya/11b9105b7fa30e34de70597409759277 to your computer and use it in GitHub Desktop.
Userscript for easy copying the item URL on http://www.xarakiri.ru/
// ==UserScript==
// @name Harakiri URL button
// @namespace http://ccrowd.in/
// @version 0.0.1
// @description Userscript for easy copying the item URL on http://www.xarakiri.ru/
// @author ilyagulya@gmail.com
// @match http://www.xarakiri.ru/catalog/*
// @grant none
// ==/UserScript==
/* jshint esnext: true */
(function() {
'use strict';
let items = $(".col").filter((key, item) => item.id.startsWith("item_"));
items.each((key, item) => {
let child = $(item).find(".item__content");
let url = `${location.href.replace(location.hash,"")}#${item.id}`;
$(`<a style="position: absolute; bottom: 6px; right: 7px; background: #f5f5f5; padding: 10px 15px; border-radius: 2px; border: 1px solid #e8e8e8; color: #000;" href="${url}">URL</a>`).appendTo(child);
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment