Greasy Fork is available in English.

Toc Bar

A floating table of content widget

Ajankohdalta 8.7.2020. Katso uusin versio.

Tekijä
hikerpig
Arvostelut
0 0 0
Versio
1.3.0
Luotu
1.7.2020
Päivitetty
8.7.2020
Lisenssi
MIT
Käytössä

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

1.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)