Pixivを見やすくするブックマークレット

Pixivのイラスト/漫画ページから余計なものを消すブックマークレットです。特に余計な画像パーツは徹底的に取り除きます。またPixivの使用が微妙に変更されたので直しついでに上げてみる。

何のためのもの?

  • Pixiv公式サイトのイラストと漫画をページ遷移なしでオリジナルサイズで見る

主な機能

  • 全体的にすっきりさせる。画像はプロフィール・イラスト/漫画・イメージレスポンス・背景画像だけ残す
    • イラスト/漫画はクリックで原寸表示切り替え
    • 背景画像はページ一番下/マウスホバーで原寸表示
  • コメントを表示させる
  • アンケートを表示させる(2回実行する必要あり)
    • 回答済みの場合は自分の回答をハイライト
  • ページタイトルを"(pixiv)[UserID-illustID]【作者名】タイトル"の形式に置き換え

※タグ検索から飛んだ場合は2回実行する必要あり
※漫画形式でページ数が多い場合、実行時にしばらく固まります。


Safari, Mobile Safari (iPad mini), Google Chrome上で動作確認済。JavascriptjQueryが動けば使えるはずなのでFirefoxでも多分動きます。


iPadSafariでも使えることが確認できたので少し用途が広がったかもしれない。
スクリプトはこちら

javascript:(function()%7Bif(location.href.match('tag='))%7Blocation.replace(location.href.split('&tag=')%5B0%5D);return;%7D$(document).ready(core);function%20core()%7Bfunction%20getImgUrl(url)%7Bvar%20src=$.ajax(%7Burl:url,async:false%7D).responseText;return%20$('img',$(src)).attr('src');%7Deval($('%23wrapper%3Escript:first').text().split('pixiv.context.').join('var%20'));if($('div.works_display%3Ea').size())%7B$('head').append('%3Cstyle%20/%3E');$('head%3Estyle:last').append('img.illust%20%7Bmax-width:%20740px;%20margin:%206px%200;%20%7D');$('head%3Estyle:last').append('img%23page_bg%20%7Bmax-width:%20100px;%20max-height:%20100px;%20%7D');$('head%3Estyle:last').append('img%23page_bg:hover%20%7Bmax-height:%20none;%20max-width:%20none;%20%7D');var%20img=$('div.works_display%3Ea%3Eimg');if($('div.works_display%3Ea').attr('href').match(/manga/))%7Bvar%20pg=parseInt($('section.work-info%3Eul.meta%3Eli:eq(1)').text().replace('漫画%20','').replace('P',''));for(i=0;i%3Cpg;i++)%7B$('%3Cdiv/%3E').attr('class','image-container').append($('%3Cimg%3E').attr(%7Bclass:'illust',src:getImgUrl(window.location.href.replace('medium','manga_big')+'&page='+i),alt:img.attr('alt')+'_p'+i,title:img.attr('alt')+'_p'+i%7D)).appendTo('div.works_display');%7D%7Delse%7B$('%3Cdiv/%3E').attr('class','image-container').append($('%3Cimg%3E').attr(%7Bclass:'illust',src:getImgUrl(window.location.href.replace('medium','big')),alt:img.attr('alt'),title:img.attr('alt')%7D)).appendTo('div.works_display');%7D$('div.works_display%3Ea').remove();loop=setInterval(function()%7B$('button.comment-show-button:visible').click();$('button.comment-more-button:visible').click();if($('button.comment-show-button:hidden').size()&&$('button.comment-more-button:hidden').size())%7Bloop=0;clearInterval(loop);%7D%7D,500);%7Dloop2=setInterval(function()%7Bif(loop)%7Breturn;%7Delse%7BclearInterval(loop2);$('section.score%3E*:not(dl)').remove();if($('section.questionnaire').size())%7Bif($('section.questionnaire%3Espan.status.toggle-list').size())%7Bif($('section.questionnaire%3Ediv.list:hidden').size())%7B$('section.questionnaire%3Espan.status.toggle-list').click();return;%7Delse%7B$('section.questionnaire%3Ediv.stats:hidden').show();$('section.questionnaire%3E*:not(div.stats)').remove();%7D%7Delse%7B$('section.questionnaire%3Ediv.stats:hidden').show();var%20t=$('section.questionnaire%3Espan.status.toggle-stats').text().split('この作品のアンケートに「')%5B1%5D.split('」と答えました')%5B0%5D;t=$('section.questionnaire%3Ediv.stats:visible%3Etable%3Etbody%3Etr').filter(function()%7Breturn%20$('th',this).text()==t%7D);t.css('color','%23258fb8');$('section.questionnaire%3E*:not(div.stats)').remove();%7D%7Dvar%20r18='';if($('section.work-info%3Eul.meta').text().match('R-18'))%7Br18='%5BR-18%5D';%7D$('title').text('(pixiv)%5B'+userId+'-'+illustId+'%5D'+r18+'【'+userName+'】'+illustTitle);$('head').contents().filter(function()%7Breturn%20this.nodeType==8%7D).remove();$('body').contents().filter(function()%7Breturn%20this.nodeType==8%7D).remove();$('body%3E*:not(%23wrapper)').remove();$('%23wrapper%3E*:not(%23contents,script:eq(0))').remove();$('div.ui-layout-west%3E*:not(div.profile_area)').remove();$('div.profile_area%3E*:not(a,h2)').remove();$('div.profile_area%3Ea').attr('href',window.location.href.split(illustId)%5B0%5D+illustId);$('div.contents-east%3E*:not(div.two_column_body)').remove();$('div.two_column_body%3E*:not(section.work-info,section.work-tags,div.works_display,div.works_info)').remove();$('section.work-info%3Ep.caption').contents().filter(function()%7Breturn%20this.nodeType==3%7D).each(function()%7B$(this).replaceWith($($('%3Cp%3E'+$(this).text()+'%3C/p%3E')).contents());%7D);if($('section.work-tags%3Edl').size())%7B$('span.tags-container').unwrap().unwrap();$('section.work-tags%3E*:not(span.tags-container)').remove();%7D$('span.tags-container%20a%5Bclass%5E=%5C'icon-pixpedia%5C'%5D').remove();$('span.tags-container%20a%5Bhref%5E=%5C'http://comic%5C.pixiv%5C.net%5C'%5D').remove();$('span.tags-container%20a.portal').remove();$('div.works_info%3Ediv.worksOption%3E:not(%5C'form.comment-area,div.worksImageresponse%5C')').remove();$('form.comment-area%3E:not(%5C'ul.comment-list%5C')').remove();$('div.worksOptionRight').remove();$('div.worksImageresponse:not(:contains(%5C'イメージレスポンス%5C'))').remove();var%20bg=$('body').css('background-image');if(bg!='none')%7B$('%3Cimg/%3E').attr(%7Bid:'page_bg',src:bg.replace('url(','').replace(')','').replace(/%5C%22/g,'').replace(/%5C'/g,''),alt:'背景画像',title:'背景画像'%7D).appendTo($('div.two_column_body'));%7D$('head%3Emeta%5Bname%5D').remove();$('%23wrapper').contents().filter(function()%7Breturn%20this.nodeType==8%7D).remove();$('input').remove();$('noscript').remove();$('script:not(:contains(%5C'pixiv.context.illustId%5C'),%5Bsrc*=%5C'jquery%5C'%5D)').remove();var%20script=document.createElement('script');script.type='text/javascript';script.text='$(document).ready(function()%7B$(%5C'img.illust%5C').toggle(function()%7B$(this).css(%5C'max-width%5C',%5C'none%5C');%7D,function()%7B$(this).removeAttr(%5C'style%5C');%7D);%7D);';document.getElementsByTagName('head')%5B0%5D.appendChild(script);%7D%7D,500);%7D%7D)();

インストール方法

  1. このページをブックマーク
  2. ブックマークを編集して、URLを↑のスクリプトに置き換える

または、このリンクをブックマークし、ブックマークの編集で最初の"http://"を削除

使い方
Pixivのイラスト/漫画ページを開き、↑で登録したブックマークを実行