Greasy Fork is available in English.

Toc Bar, 文章大纲

在页面右侧展示一个浮动的文章大纲目录

您查看的为 2020-07-08 提交的版本。查看 最新版本

脚本作者
hikerpig
得分
0 0 0
版本
1.4.0
创建日期
2020-07-01
最近更新
2020-07-08
许可证
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

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)