Skip to content

Minimal speed-dial extension with support for keyboard shortcuts & importing Speed Dial pages

License

Notifications You must be signed in to change notification settings

ahimta/speed-dial-quantum

Repository files navigation

Speed Dial Quantum

Travis Known Vulnerabilities Code Climate Code Climate JavaScript Style Guide code style: prettier license Inline docs

Mozilla Add-on Mozilla Add-on Mozilla Add-on Mozilla Add-on

Chrome Web Store Chrome Web Store Chrome Web Store Chrome Web Store

Minimal speed-dial extension with support for keyboard shortcuts & importing Speed Dial pages

Prerequisites

  1. Node (using version in .nvmrc)
  2. yarn (can be installed using just npm install --global yarn)

Build

yarn install --emoji
yarn run build

Develop

yarn install --emoji
yarn run build
yarn start

# in another terminal window/tab
yarn run watch

Test

yarn install --emoji
yarn run build
yarn test

# for test coverage (`coverage/lcov-report/index.html` will be generated)
yarn run coverage

Package

yarn install --emoji
NODE_ENV=production yarn run build
yarn run package

Publish Packeged Extension

  1. Make sure you've made a release commit that only updates the version and have a Release <version>:smiley: message
  2. Clone the repo locally and zip it (to upload it later to Mozilla). Using something like cd <path-to-use> && git clone <local-repo-path> && zip -r speed-dial-quantum.zip speed-dial-quantum
  3. Go to extension's Mozilla page and submit packaged extension (enabling only desktop platforms and not Android) and don't forget to upload the cloned local repo (required by Mozilla because the code is transformed using Rollup, etc...)
  4. Go to extension's Chrome store page and submit packaged extension and don't forget to publish it

Upgrade Packages

  1. Run yarn outdated --emoji
  2. Check changelogs from URLs
  3. Run yarn upgrade --emoji
  4. Run yarn add <package>@^<version> --emoji for breaking updates
  5. Run yarn run audit to check for vulnerabilities
  6. Make sure yarn run {build,package,test,watch} still work correctly

Download & Update Static Dependencies

  1. cd vendor
  2. Download using wget -O <dep-name>-<dep-version>.<dep-extension> <dep-url>
  3. Run cat <dep-file-name> | openssl dgst -sha384 -binary | openssl base64 -A
  4. Copy output and add it as an integrity HTML atribute
  5. Update HTML's tag reference (href or src)
  6. Remove older version files
  7. Try the extension and make sure everything works

Clean

yarn run clean

Design (in Scala)

Entities

Thumbnail(
  id: String,
  groupId: String,

  title: Option[String],
  url: Option[String],
  // @deprecated
  imgUrl: Option[String],

  faviconImgUrl: () => String
)

Group(
  id: String,
  name: String,

  rows: Option[Int],
  cols: Option[Int],
  thumbnailImgSize: Option["auto" | "small" | "medium" | "large"],

  thumbnails: () => Array[Thumbnail],
)

Tab(groups: Array[Group], thumbnails: Array[Thumbnail])

Constraints

Tab#groups.map(g => g.thumbnails().length).sum() == Tab#thumbnails.length

Known Issues & Limitations

  • Keyboard shortcuts only work when the page is focused (because a content script is used)
  • Alt shortcuts don't work properly on Firefox Windows:sweat_smile:

Todo

  • Replace injected web scripts with global shortcut
  • Add specs for tab and thumbnail entites
  • Auomated tests, better architecture, etc...