次のページ・前のページへ移動するブックマークレット
<link rel="next" href="...">とか<link rel="prev" href="...">を参照すればいいんじゃないかと思った。
次のページに移動:
javascript:(function(){var%20xs=document.evaluate("//link[@rel='next'%20or%20@rel='NEXT']/@href",document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null);if(xs.singleNodeValue)location.href=xs.singleNodeValue.textContent;})();
前のページに移動:
javascript:(function(){var%20xs=document.evaluate("//link[@rel='prev'%20or%20@rel='PREV'%20or%20@rel='previous'%20or%20@rel='PREVIOUS']/@href",document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null);if(xs.singleNodeValue)location.href=xs.singleNodeValue.textContent;})();
XPath 2.0のlower-caseを使いたかったのだが、なんかdocument.evaluateのやつはXPath 1.0らしくて無理だった。
しかし使えるサイトが少ないな。ブログだと使えるところもある。検索結果だと使えない。みんな<link rel="(next|prev)">を埋め込んでくれ~
スポンサーサイト