diff --git a/lib/pxer.user.js b/lib/pxer.user.js index 090c2f3..7944e21 100644 --- a/lib/pxer.user.js +++ b/lib/pxer.user.js @@ -1,22 +1,33 @@ // ==UserScript== // @name Pxer-6 +// @version 6.0.2 // @namespace https://github.com/pea3nut/Pxer +// @author 花生PeA // @description pixiv.net Tools +// @grant none // @include http://www.pixiv.net/member_illust.php* // @include http://www.pixiv.net/bookmark.php* // @include http://www.pixiv.net/search.php* // ==/UserScript== javascript:void((function() { - pxerDefinePxerConfig ={ - "URL_ROOT":"http://127.0.0.1/github/pxer-beta-6/", - "TEMPLATE_URL":'lib/template.php', - "DEBUG":false, - "CACHE":true, + function loadPxer(){ + window.pxerDefinePxerConfig ={ + "URL_ROOT":"http://127.0.0.1/github/pxer-beta-6/", + "TEMPLATE_URL":'lib/template.php', + "DEBUG":false, + "CACHE":true, + }; + document.head.appendChild( + document.createElement("script") + ).src + =window.pxerDefinePxerConfig['URL_ROOT']+"lib/launcher.js" + +"?pixiv_id="+document.cookie.match(/PHPSESSID=(\d+)/)[1] + +"&time="+(new Date()).getTime() + ; + }; + if(document.readyState !=='loading'){ + setTimeout(loadPxer); + }else{ + document.addEventListener('DOMContentLoaded' ,loadPxer); }; - document.head.appendChild( - document.createElement("script") - ).src - =window.pxerDefinePxerConfig['URL_ROOT']+"lib/launcher.js" - +"?pixiv_id="+document.cookie.match(/PHPSESSID=(\d+)/)[1] - +"&time="+(new Date()).getTime() })());