stefanw / bibbot

BibBot is a browser extension that removes the paywall on German online news sites using your library account's access to press databases.
https://stefanw.github.io/bibbot/
GNU General Public License v3.0
499 stars 78 forks source link
paywall

BibBot

Official website

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:

These are the relevant players:

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

  1. Run npm version <major|minor|patch>
  2. git push --tags origin main
  3. GitHub release Action will build, test, create release, sign Firefox extension, submit to Chrome Web Store and update website.