Skip to content

Latest commit

 

History

History
86 lines (54 loc) · 3.39 KB

CONTRIBUTING.md

File metadata and controls

86 lines (54 loc) · 3.39 KB

Contributing guidelines

Reporting broken sites

Report broken websites using the "Report Broken Site" link on the extension popup.

Reporting bugs

  1. First check to see if the bug has not already been reported.
  2. Create a bug report issue.

Feature requests

There are two ways to submit feedback:

  1. You can send anonymous feedback using the "Send feedback" link on the extension's options page.
  2. You can submit your request as an issue. First check to see if the feature has not already been suggested.

Development

New features

Right now all new feature development is handled internally.

Bug fixes

Most bug fixes are handled internally, but we will except pull requests for bug fixes if you first:

  1. Create an issue describing the bug. see Reporting bugs
  2. Get approval from DDG staff before working on it. Since most bug fixes and feature development are handled internally, we want to make sure that your work doesn't conflict with any current projects.

Testing locally

Pre-Requisites

Building the extension

  • Firefox
  1. Run npm run dev-firefox
  2. Load the extension in Firefox from the build/firefox/dev directory Temporary installation in Firefox - Mozilla | MDN
  • Chrome
  1. Run npm run dev-chrome
  2. Load the extension in Chrome from the build/chrome/dev directory Getting Started: Building a Chrome Extension - Google Chrome
  • Safari

    The Safari extension is no longer supported.

Development flow

The shared directory contains JS, CSS, and images that are shared by all browsers.

The popup UI is in shared/js/ui

The background JS is in shared/js/

Browser specific files, including manifest files, are located in browsers/<browser-name>

Run the dev build task for your browser from the 'Build' section above. The generated build files are located in /build/<browser>/dev.

After running the build task it will continue watching for changes to any of the source files. After saving any changes to these files it will automatically rebuild the dev directory for you.

Testing

  • Unit tests: npm test
  • Integration Tests
    • Local, requires Chrome: npm run test-int
    • Headless, requires xvfb: npm run test-ci

Selenium Testing (ratings.js)

Setup

  1. For remote linux machine, first setup xvfb: source selenium-test/setup.sh
  2. npm install
  3. grunt

Testing Single Site ./selenium-test/ratings.js -u https://website.com

Testing Top 500 ./selenium-test/ratings.js -n 2 (where n = [1 - 500])

Testing Multiple Sites ./selenium-test/ratings.js -f urls.txt (file should have 1 url on each line)

Using XVFB To test on a remote server with XVBF installed, add -x flag: ./selenium-test/ratings.js -x -u https://website.com