Update: code

This commit is contained in:
bitdust 2017-05-13 15:56:20 +08:00
parent 6c30e0af09
commit 94e019a15a
2 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
// ==UserScript==
// @name Douban2Piratebay
// @namespace https://github.com/bitdust/Douban2Piratebay/
// @version 0.4
// @version 0.5
// @description And direct link to piratebay from douban movie page.
// @author bitdust
// @match https://movie.douban.com/subject/*

View File

@ -1,7 +1,7 @@
// ==UserScript==
// @name Douban2Piratebay
// @namespace https://github.com/bitdust/Douban2Piratebay/
// @version 0.4
// @version 0.5
// @description And direct link to piratebay from douban movie page.
// @author bitdust
// @match https://movie.douban.com/subject/*
@ -13,10 +13,10 @@
(function() {
'use strict';
// Your code here...
function insertAfter(newNode, referenceNode) {
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
}
var links = document.querySelectorAll (
"#info > a"
);
@ -28,6 +28,7 @@
break;
}
}
if (imdblink !== null) {
var imdbindex = imdblink.innerText;
var fragment = document.createDocumentFragment();
@ -35,7 +36,6 @@
var parent = imdblink.parentElement;
var span = imdblink.previousElementSibling.cloneNode(false);
span.textContent = "海盗湾链接: ";
span.class = 'pl';
var a = imdblink.cloneNode(true);
a.href = 'https://thepiratebay.org/search/' + imdbindex;
fragment.appendChild(br);