Greasemonkey: continue_reading.user.js

continue_reading.user.js

SITEINFOなしで動くAutoPagerize的な何か。

nextLinkの推定

Greasemonkey: nisefastforward5.user.js - mayokara note

nisefastforward5.user.jsと同じく、以下の順で探索。

  1. link[@rel="next"]
  2. a[@rel="next"]
  3. 特定のキーワードで始まるリンク(デフォルトは「Next」「次」の2つ)
  4. URLをインクリメントして、そこにリンクが貼られていればそれを使う
  5. テキストが「2」ちょうどのリンク

@rel="next"が存在せず、@rel="prev"のみが存在するときは進行方向を逆にする(Twitterなど)。

pageElementの推定

JavaScript: pageElementの推定 - mayokara note

これの「親要素も使う」版を手直ししたものを採用。

親・子ノードとの描画領域比を使う。

ちょっと重いかも。

microformatsが見つかったときは、それを利用する。

microformats

hAtom、xFolk、AutoPagerize独自形式に対応。

AutoPagerizeとの互換性

window.AutoPagerize.addDocumentFilterwindow.AutoPagerize.addFilterを実装。

その他

  • GM_xmlhttpRequestdocument.implementation.createDocument+Range#createContextualFragment方式
  • 任意の場所をダブルクリックでON/OFF切り替え

Comment: 0

コメントの受け付けは終了しました。

Trackback: 0

トラックバックの受け付けは終了しました。