LoginSignup
4
4

More than 5 years have passed since last update.

Gist のページャーを使いやすくする Google Chrome 拡張つくりました

Posted at

Gist のページャーが Newer と Older しか無くてつらくなる可能性があったのでページャーを使いやすくする Google Chrome 拡張をつくりました。

ImproveGistPager.png

Github

Chrome ウェブストア

作ったうえで得られた知識

MutationObserver で DOM の変更を検知する

  • Gist は最初にページを読み込むときは通常の GET リクエストなので、window.onload イベントが動くけども、Newer または Older をクリックして遷移すると、pushState を使っているのか window.onload イベントが動かない。そのため、Javascript で DOM が書き換えられたタイミングでも拡張機能が動くように、MutationObserver というものを使った。
4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4