From 103559ef64001a9971433f2fe801e08a5f189e1d Mon Sep 17 00:00:00 2001 From: mitsugu oyama Date: Fri, 5 Nov 2010 19:47:41 +0900 Subject: bug fix. スタックトレースからの表示ページの 画像、漫画をダウンロード可能にする fixを実施 --- pixiv.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'pixiv.js') diff --git a/pixiv.js b/pixiv.js index 85f08e8..441282a 100644 --- a/pixiv.js +++ b/pixiv.js @@ -36,18 +36,25 @@ commands.addUserCommand( let Cc=Components.classes; let Ci=Components.interfaces; - let baseInfo; + let id; + if(-1==contents.URL.search(/\&from_sid=/i)){ + id=contents.URL.substr(contents.URL.lastIndexOf('=')+1); + }else{ + let st=contents.URL.search(/illust_id=/i)+'illust_id='.length; + let end=contents.URL.lastIndexOf('&'); + id=contents.URL.substr(st,end-st); + } + + let baseInfo; let scroll; let type=contents.getElementsByClassName('works_display').item(0) .firstChild.getAttribute('href'); if(-1!=type.search(/big&illust_id=/i)){ baseInfo="http://www.pixiv.net/member_illust.php?mode=big&illust_id="; - id=contents.URL.substr(contents.URL.lastIndexOf('=')+1); scroll=''; }else if(-1!=type.search(/manga&illust_id=/i)){ baseInfo="http://www.pixiv.net/member_illust.php?mode=manga&illust_id="; - id=contents.URL.substr(contents.URL.lastIndexOf('=')+1); scroll='&type=scroll'; }else{ liberator.echoerr("This page is not image page and not manga page."); -- cgit v1.2.3