WebScience is a library for building browser-based research studies.
npm install @mozilla/web-scienceIf you would prefer to build a browser extension with WebScience from scratch, we recommend the following steps:
* Use Node.js for managing the extension's dependencies with a package.json file and npm install. WebScience is available on npm as the package @mozilla/web-science.
* Use Rollup with @rollup/plugin-node-resolve, @rollup/plugin-commonjs, and @mozilla/web-science/rollup-plugin to integrate the library into your bundled extension.
js
import * as webScience from "@mozilla/web-science";
`
You will then be able to use the WebScience API within the background script (e.g., webScience.pageNavigation...).You can also selectively import components of the WebScience API, if you prefer. Just add, for example:
`js
import { pageNavigation, socialMediaLinkSharing } from "@mozilla/web-science";
`
You will then be able to use those components of the API (e.g., pageNavigation...).Exploring the WebScience API
Documentation for the latest release of WebScience is available at https://mozilla-rally.github.io/web-science/jsdocs/. The documentation is automatically generated from JSDoc annotations in the WebScience implementation.API Implementation Progress
| Module | No Breaking Changes Planned | No Known Bugs | Good Documentation | Good Test Coverage | Browser Support |
| ------------------------ | --------------------------- | ------------------ | ------------------ | ------------------ | ------------------ |
| debugging | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | Firefox, Chrome |
| events | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | Firefox, Chrome |
| id | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | Firefox, Chrome |
| idle | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | Firefox, Chrome |
| inline | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | Firefox, Chrome |
| linkExposure | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | Firefox |
| linkResolution | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | Firefox |
| matching | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | Firefox, Chrome |
| messaging | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | Firefox, Chrome |
| pageManager | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | Firefox, Chrome |
| pageNavigation | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | Firefox, Chrome |
| pageText | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | Firefox, Chrome |
| pageTransition | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | Firefox |
| permissions | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | Firefox, Chrome |
| randomization | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | Firefox, Chrome |
| scheduling | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | Firefox, Chrome |
| socialMediaActivity | :x: #23 | :white_check_mark: | :white_check_mark: | :x: | Firefox |
| socialMediaLinkSharing | :x: #17 | :white_check_mark: | :white_check_mark: | :x: | Firefox |
| storage | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | Firefox, Chrome |
| timing | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | Firefox, Chrome |
| userSurvey | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | Firefox |
| workers` | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | Firefox, Chrome |