Toc Bar

A floating table of content widget

2020/07/13のページです。最新版はこちら。

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください。
作者
hikerpig
評価
0 0 0
バージョン
1.4.2
作成日
2020/07/01
更新日
2020/07/13
ライセンス
MIT
対象サイト

Toc Bar

A user script that adds floating widget displaying table of content of current page.

Currently only tailored for some personal most-visited sites. Feel free to tweak the settings or open a PR.

✨Features

  • Use tocbot for toc generation.
  • For some sites, there are no ids on header elements so it would be impossible to navigate by clicking the toc link. Toc Bar will generate ids - which are derived from a simple hash of the header textContent, and prefixed with tocbar- - for these headers.
  • A toggle button is offered, if you don't want toc bar to cover current page content.
  • For some sites in SPA mode, if you navigate to another article, there is no easy way detecting url change in userscript, so I add a refresh button to refresh TOC contents.

Screenshots

devto

zhuanlan-sspai

Acknowledgements

Inspired by github-toc by Mottie.

The logo uses Mexellent font made by Raymond Larabie.

CHANGELOG

v1.4.2 (2020-07-13)

  • fix: Toc trigger shrinks outside page when toggling off (4722d05)
  • feat: Add match *://www.zhihu.com/pub/reader/*, and fix a little style (36269a5)

v1.4.1 (2020-07-10)

  • fix: isEmpty dysfunctioning (8374ceb)

v1.4.0 (2020-07-08)

  • feat: Add match *://learning.oreilly.com/library/view/* (c6648ce)
  • feat: Add site ://developer.chrome.com/extensions/ (27eb121)
  • optimize: should ignore empty cachedPosition (61b0eab)
  • Add @icon for displaying logo (c33e258)

v1.3.0 (2020-07-05)

Features

  • store tocbar position and toggle status using GM_setValue, read them during init
  • add initialTop to site setting

v1.2.0 (2020-07-05)

Features

  • Add logo, and adjust some styles (ba90dac)

v1.1.0 (2020-07-04)

Features

  • Add header hash functionality (970dd0a)
  • guess theme color from document.head meta (4db05b5)
  • remove tocbot style resource, add a modified version to tocbar style (5ebdde0)