diff --git a/Douban2Piratebay.user.js b/Douban2Piratebay.user.js index 63db24c..22cdc11 100644 --- a/Douban2Piratebay.user.js +++ b/Douban2Piratebay.user.js @@ -14,38 +14,40 @@ 'use strict'; function insertAfter(newNode, referenceNode) { - referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); + $(newNode).appendTo(referenceNode); } function addLink(fragment, text, href){ - let a = imdblink.cloneNode(true); + let a = document.createElement("a") a.textContent = text; a.href = href; fragment.appendChild(a); } var links = document.querySelectorAll ( - "#info > a" + "#info" ); - var imdblink = null; - var imdbRe = new RegExp("tt[0-9]{4,}"); + var imdbLink = null; + var imdbindex = null; + var imdbRe=new RegExp(".*?(tt[0-9]{4,})"); for (var i=0; i