A zero-build Chrome Manifest V3 extension that adds to GitHub's numeric pagination:
- ⏮️ Jump-to-first-page button
- 🔢 Type a page number and press Enter to jump
- ⏭️ Jump-to-last-page button
- 📌 Click the toolbar icon to toggle "Fixed pagination", which pins the paginator to the bottom of the viewport (off by default)
🎨 Controls use GitHub's Primer color variables, automatically adapting to GitHub's light, dark, and high-contrast themes, and support GitHub's partial page navigation.
- Open
chrome://extensions/in Chrome. - Enable "Developer mode" in the top-right corner.
- Click "Load unpacked".
- Select the cloned folder (the one containing
manifest.json). - Open or refresh any GitHub page with numeric pagination.
🔒 The extension only runs on https://github.com/*, uses the storage permission solely to remember your preferences, and never collects or sends data.
Every release also ships a Tampermonkey userscript built from the same sources:
- Install the Tampermonkey extension.
- Download github-page-jump.user.js from the latest release.
- Confirm the Tampermonkey install prompt.
The "Fixed pagination" toggle lives in the Tampermonkey menu, and new releases update automatically through the release attachment.
The extension has no runtime dependencies and no build step. Run the full test suite with:
npm testThe source is split by responsibility:
src/core.jscontains pure pagination and URL logic.src/shared.jsowns localization, setting definitions, and the Chrome Storage adapter.src/pagination.jsadapts GitHub pagination markup and manages injected controls.src/content.jsandsrc/popup.jsare thin entry points.scripts/build-userscript.jspackages the shared modules into the Tampermonkey userscript (npm run build:userscript).scripts/userscript-boot.jsprovides the userscript-only storage adapter, menu toggle, and boot.
Add support for new GitHub markup through PAGINATION_ADAPTERS. Register new preferences once in SETTING_DEFINITIONS, then consume them through the shared settings store. Keep manifest.json and tests/fixture.html script order aligned when adding a source module.
Keep the versions in package.json and manifest.json identical. On every push to main, GitHub Actions checks whether the v<version> tag exists on the remote; when it does not, the workflow runs the tests, packages the extension and the userscript, creates the tag, and publishes a GitHub Release with both attached. Versions that already have a tag are skipped.
一个无需构建步骤的 Chrome Manifest V3 扩展,为 GitHub 数字分页器增加:
- ⏮️ 跳转到第一页按钮
- 🔢 输入页码并按回车跳转
- ⏭️ 跳转到最后一页按钮
- 📌 点击工具栏图标可开关“固定分页器”,开启后分页器悬浮固定在视口底部(默认关闭)
🎨 控件使用 GitHub 的 Primer 颜色变量,自动适配 GitHub 的亮色、暗色与高对比度主题,并支持 GitHub 的局部页面导航。
- 打开 Chrome 的
chrome://extensions/。 - 打开右上角的“开发者模式”。
- 点击“加载已解压的扩展程序”。
- 选择克隆下来的项目文件夹(即包含
manifest.json的目录)。 - 打开或刷新任意带数字分页器的 GitHub 页面。
🔒 扩展只在 https://github.com/* 中运行,storage 权限仅用于记住你的偏好设置,不会收集或发送数据。
每个 Release 都会附带由同一套源码构建的 Tampermonkey 用户脚本:
- 安装 Tampermonkey 扩展。
- 从最新 Release 下载 github-page-jump.user.js。
- 在 Tampermonkey 的安装提示中确认即可。
“固定分页器”开关位于 Tampermonkey 菜单中,发布新版本后会通过 Release 附件自动更新。
扩展没有运行时依赖,也不需要构建。运行完整测试:
npm test源码按职责拆分:core.js 负责纯分页逻辑,shared.js 负责本地化与设置存储,pagination.js 负责适配 GitHub DOM 和控件生命周期,content.js、popup.js 只负责启动与绑定;scripts/build-userscript.js 把共享模块打包成 Tampermonkey 用户脚本(npm run build:userscript),scripts/userscript-boot.js 提供用户脚本专用的存储适配器、菜单开关与引导。
支持新的 GitHub 分页结构时扩展 PAGINATION_ADAPTERS;增加偏好设置时先在 SETTING_DEFINITIONS 中注册,再通过共享设置存储访问。新增源码模块后,需要同步 manifest.json 与 tests/fixture.html 中的脚本顺序。
package.json 与 manifest.json 中的版本号必须保持一致。每次推送到 main 后,GitHub Actions 会检查远端是否存在对应的 v<版本号> tag:不存在时自动运行测试、打包扩展与油猴脚本、创建 tag,并发布附带两者的 GitHub Release;已有 tag 的版本会自动跳过。