项目
在 GitHub 查看
stefanw/bibbot
关于
BibBot 是一个浏览器扩展,利用图书馆账户对新闻数据库的访问权限,移除德国在线新闻网站的付费墙。
数据与分析实测星标增长
- 24小时
- 0
- 7天
- +1
- 15天
- +2
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文BibBot
Development
This uses rollup to build the extension files. Install and run like this:
npm install
# Run this during development
npm start
Extension overview
The extension has four different entry points:
- The content script in
src/content.tsruns on the news article page, communicates with background script - the background script in
src/background.tswhich opens new tabs, navigates them around and scrapes the content - the options page in
src/options.tsis the options page for the extension - the popup in
popup/is opened when the extension icon in the toolbar is clicked
These are the relevant players:
src/providers.tscontains libraries that you authenticate against and that grant accesssrc/sources.tscontains databases that you can get access to through providerssrc/sites.tscontains news sites, how to extract their meta data and which source could provide access
For details on how to construct any of these entities, have a look at src/types.ts
Additionally user data like credentials and chosen provider is stored via browser.storage.sync.
Tests
There is a test setup for sites using Playwright that can be run with:
# install dependencies
npm ci
# Run linting and type checking
npm run lint
npm run check-types
# Always run build before tests, as test uses build files!
npm run build
# Run tests
npm run test
# Run tests with actual browser window for one domain
npm run test -- --headed -g "zeit.de"
Add testing data to site objects like this:
// ...
'www.example.com': {
examples: [
{
url: 'http://example.com/article.html',
selectors: {
query: 'The string resulting from query selector'
}
}
],
// optional setup async function
testSetup: async (page) => {
// page is playwright page
// use this for initial page setup
},
// ...
Release
- Run
npm version <major|minor|patch> git push --tags origin main- GitHub release Action will build, test, create release, sign Firefox extension, submit to Chrome Web Store and update website.
探索相关项目
加载中…