Skip to content

Commit

Permalink
Release 2019.3.22 (#368)
Browse files Browse the repository at this point in the history
* Make sure Site class is kept up-to-date (#337)

* add extra listener to make sure navigation isn't missed

* handle local-ntp URL that chrome gives us on the new tab

* fix incorrect var

* add unit tests

* move companies.buildfromstorage to onStartup

* Root domains of subdomains on temp whitelist should not be whitelisted (#352)

* root domains of subdomains on temp whitelist should not be whitelisted

* tweak test

* fix isRelatedEntity regex matching (#354)

* fix regex, use test instead of match

* add resources too

* lint

* excape all regex chars, add tests

* comment

* comment

* make sure we're properly matching on subdomains (#357)

* Update LICENSE (#361)

* Update readme and add issue templates (#359)

* Updating the readme and contributing docs

* add readme links

* add issue templates

* add bug and feature templates

* update issue templates

* fix markdown spacing in templates

* update license so it is picked up by github

* update readme links

* fix license formatting

* hide lastError from sendMessage (#363)

* hide last error from sendMessage

* add lastError comments

* new grade icons (#366)

* Release 2019.3.22
  • Loading branch information
MariagraziaAlastra authored Mar 22, 2019
1 parent eda6f3a commit db503a5
Show file tree
Hide file tree
Showing 27 changed files with 201 additions and 99 deletions.
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/Feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Feature request
about: Suggest new features for the extension

---

## Summary
<!-- Explanation of the feature. -->

## Motivation
<!--
What use cases does it support?
What is the expected outcome?
Are there other extensions that have this feature?
-->

## Additional context
<!--
Include any additional context that you think would be helpful. Somethings you can include that will help us categorize the request are:
- Priority: Is this a nice to have feature or critical missing feature.
- Impact: Who will benefit from this feature? Will a small subset of uses want it or is this something all users will want.
- Screenshots or drawings if applicable.
- Examples of other extensions or applications that might have this feature.
-->
48 changes: 48 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: Bug report
about: Use this template for reporting a bug.

---

<!--
This form is for reporting bugs or issues with the extension and not to report broken sites. To report a broken site use the 'Report Broken Site' link on the extension popup.
**Make sure that the bug you are reporting is reproducible on the latest version of the extension**
-->

## Description
<!-- Description of the issue -->

## Steps to Reproduce
<!-- How can we reproduce the bug ourselves -->
1. step 1
2. step 2
3. ...

**Expected behavior:**
<!-- What you expect to happen -->

**Actual behavior:**
<!-- What actually happens -->

**Versions**

<!--
To find the extension versions:
Firefox: go to about:addons in the address bar, click DuckDuckGo Privacy Essentials, version is toward the bottom of the page.
Chrome: go to about:extensions in the address bar, click "details" on DuckDuckGo Privacy Essentials, the version is listed near the top of the page.
-->

- Extension: 20xx-xx-xx
- Browser: <!-- Firefox, Chrome, Vivaldi ... Version number is not needed, but let us know if you're not on the normal production version of the browser. -->
- OS: <!-- Windows, Linux, Mac. Version number for the OS is not needed -->

## Additional Information
<!--
Provide additional context (optional):
1. Is the issue repeatable or intermittent?
2. Did this issue start after an upgrade to a new extension version? If so, can you repeat it using a pervious extension version?
3. Are there any errors in the extension debugging console?
4. Include screenshots if they're helpful.
-->
86 changes: 86 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# 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](https://github.com/duckduckgo/duckduckgo-privacy-extension/issues).
2. Create a bug report [issue](https://github.com/duckduckgo/duckduckgo-privacy-extension/issues/new?template=bug_report.md).

# 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](https://github.com/duckduckgo/duckduckgo-privacy-extension/issues/new?template=feature_request.md). First check to see if the feature has not already been [suggested](https://github.com/duckduckgo/duckduckgo-privacy-extension/issues).

# 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](CONTRIBUTING.md#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
- [Node.js](https://nodejs.org) installation
- [Grunt](https://www.npmjs.com/package/grunt)
- Tests use [Selenium Webdriver](http://seleniumhq.github.io/selenium/docs/api/javascript/index.html).

### 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](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Temporary_Installation_in_Firefox)

- 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](https://developer.chrome.com/extensions/getstarted#unpacked)

- 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`
5 changes: 5 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
This license does not apply to any DuckDuckGo logos or marks that may be contained
in this repo. DuckDuckGo logos and marks are licensed separately under the CCBY-NC-ND 4.0
license (https://creativecommons.org/licenses/by-nc-nd/4.0/), and official up-to-date
versions can be downloaded from https://duckduckgo.com/press.

Copyright 2010 Duck Duck Go, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
96 changes: 12 additions & 84 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,99 +2,27 @@

[![Build Status](https://travis-ci.org/duckduckgo/duckduckgo-privacy-extension.svg?branch=develop)](https://travis-ci.org/duckduckgo/duckduckgo-privacy-extension)

DuckDuckGo Firefox, Chrome, and Safari extensions
DuckDuckGo Firefox and Chrome extensions

This software is licensed under the terms of the Apache License, Version 2.0 (see LICENSE). Copyright (c) 2012 - 2017 [duckduckgo.com](https://duckduckgo.com)
This software is licensed under the terms of the Apache License, Version 2.0 (see [LICENSE](LICENSE)). Copyright (c) 2012 - 2019 [duckduckgo.com](https://duckduckgo.com)

## Pre-Requisites
- [Node.js](https://nodejs.org) installation
- Tests use [Selenium Webdriver](http://seleniumhq.github.io/selenium/docs/api/javascript/index.html) and require:
## Latest Versions

## Set up development environment
- `npm install` from root directory
[Firefox](https://addons.mozilla.org/en-US/firefox/addon/duckduckgo-for-firefox/)

## Build
- Firefox:
`npm run dev-firefox`
Load the extension in Firefox from the `build/firefox/dev` directory
[Temporary installation in Firefox - Mozilla | MDN](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Temporary_Installation_in_Firefox)
[Chrome](https://chrome.google.com/webstore/detail/duckduckgo-privacy-essent/bkdgflcldnnnapblkhphbgpggdiikppg)

- Chrome:
`npm run dev-chrome`
Load the extension in Chrome from the `build/chrome/dev` directory
[Getting Started: Building a Chrome Extension - Google Chrome](https://developer.chrome.com/extensions/getstarted#unpacked)
## Reporting a broken site

- Safari:
`npm run dev-safari`
Report broken sites using the anonymous "Report Broken Site" link in the extension popup.

Load the extension in Safari from the `build/duckduckgo.safariextension/dev/duckduckgo.safariextension` directory using the [extension builder](https://developer.apple.com/library/content/documentation/Tools/Conceptual/SafariExtensionGuide/UsingExtensionBuilder/UsingExtensionBuilder.html)
## Reporting bugs


## Development flow
Shared JS, CSS, and images are located in the `shared` directory.

Popup: `shared/js/ui`
Background: `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 build files are located in `/build/<browser>/dev`. Point your browser to this location to load the extension:

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 can be run from the dev version of the extension by going to
Firefox: `moz-extension://<yourExtensionID/test/index.html`
Chrome: `chrome-extension://<yourExtensionID/test/index/html`

An easy way to find your extension ID is to go to the `settings` page for the extension. The window URL will have the extension ID in it.

### Selenium Testing (ratings.js)

**Setup**

1. For remote linux machine, first setup xvbf: `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`

## Extension Development and Release Plan
** Please make an [issue](https://github.com/duckduckgo/duckduckgo-privacy-extension/issues/new) before working on any new features or bug fixes.**
See [Reporting bugs](CONTRIBUTING.md#reporting-bugs)

## Development
- New features and bug fixes should be made against the `develop` branch

## Releasing New Versions
- Create a new branch off of `develop` with the format: `rc-<release version>`

### Chrome
- Update the manifest version in `browsers/chrome/manifest.json`
- Build a release version: `npm run release-chrome`
- Test `build/chrome/release` locally
- A date versioned zip file is automatically built `build/chrome/release/chrome-release-YYYYMMDD-hhmmss.zip`
- Merge the release branch into master
- Upload the zip file to the Chrome store

### Firefox
- Update the manifest version in `browsers/firefox/manifest.json`
- Build a release version: `npm run release-firefox`
- Test `build/firefox/release` locally
- Merge the release branch to master
- Move to the release directory: `cd build/firefox/release`
- Use `web-ext` to package, sign, and upload to the Firefox Addon store
- `web-ext sign --api-key=$JWT_ISSUER --api-secret=$JWT_SECRET`
We're not accepting new feature pull requests right now. For bug fixes see [Development](CONTRIBUTING.md#development)

### Safari
- Update the version numbers in `browsers/duckduckgo.safariextension/Info.plist`. You need to update both `CFBundleVersion` and `CFBundleShortVersionString`.
- Build a release version. Follow the same build steps from the build section above. Use `npm run dev-safari`.
- Test locally
- Before building a package with Safari extension builder you need to clear your company stats and localStorage otherwise your data will be packaged in the release version.
In the extension console run `localStorage.clear()` and `Companies.resetData()`.
- Build a package through the extension builder.
## Questions or help with the search engine
See [help pages](https://duck.co/help)
2 changes: 1 addition & 1 deletion browsers/chrome/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "__MSG_appName__",
"description": "__MSG_appDesc__",
"default_locale": "en",
"version": "2019.3.6",
"version": "2019.3.22",
"icons": {
"16": "img/icon_16.png",
"48": "img/icon_48.png",
Expand Down
2 changes: 1 addition & 1 deletion browsers/firefox/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"strict_min_version": "57.0"
}
},
"version": "2019.1.31",
"version": "2019.3.22",
"description": "Privacy, simplified. Protect your data as you search and browse: tracker blocking, smarter encryption, private search, and more.",
"icons": {
"16": "img/icon_16.png",
Expand Down
1 change: 1 addition & 0 deletions shared/img/toolbar-rating-a.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed shared/img/[email protected]
Binary file not shown.
1 change: 1 addition & 0 deletions shared/img/toolbar-rating-b-plus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed shared/img/[email protected]
Binary file not shown.
1 change: 1 addition & 0 deletions shared/img/toolbar-rating-b.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed shared/img/[email protected]
Binary file not shown.
1 change: 1 addition & 0 deletions shared/img/toolbar-rating-c-plus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed shared/img/[email protected]
Binary file not shown.
1 change: 1 addition & 0 deletions shared/img/toolbar-rating-c.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed shared/img/[email protected]
Binary file not shown.
1 change: 1 addition & 0 deletions shared/img/toolbar-rating-d-minus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions shared/img/toolbar-rating-d.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed shared/img/[email protected]
Binary file not shown.
1 change: 1 addition & 0 deletions shared/img/toolbar-rating-f.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed shared/img/[email protected]
Binary file not shown.
4 changes: 2 additions & 2 deletions shared/js/background/chrome-events.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ chrome.tabs.onRemoved.addListener((id, info) => {
tabManager.delete(id)
})

// message popup to close when the active tab changes
chrome.tabs.onActivated.addListener(() => chrome.runtime.sendMessage({closePopup: true}))
// message popup to close when the active tab changes. this can send an error message when the popup is not open. check lastError to hide it
chrome.tabs.onActivated.addListener(() => chrome.runtime.sendMessage({closePopup: true}, () => chrome.runtime.lastError))

// search via omnibox

Expand Down
3 changes: 2 additions & 1 deletion shared/js/background/chrome-wrapper.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ let getExtensionId = () => {
}

let notifyPopup = (message) => {
chrome.runtime.sendMessage(message)
// this can send an error message when the popup is not open. check lastError to hide it
chrome.runtime.sendMessage(message, () => chrome.runtime.lastError)
}

let normalizeTabData = (tabData) => {
Expand Down
3 changes: 2 additions & 1 deletion shared/js/background/classes/site.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ class Site {
* Send message to the popup to rerender the whitelist
*/
notifyWhitelistChanged () {
chrome.runtime.sendMessage({'whitelistChanged': true})
// this can send an error message when the popup is not open check lastError to hide it
chrome.runtime.sendMessage({'whitelistChanged': true}, () => chrome.runtime.lastError)
}

isWhiteListed () { return this.whitelisted }
Expand Down
16 changes: 8 additions & 8 deletions shared/js/background/classes/tab.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
* }
*/
const gradeIconLocations = {
'A': 'img/toolbar-rating-a@2x.png',
'B+': 'img/toolbar-rating-b-plus@2x.png',
'B': 'img/toolbar-rating-b@2x.png',
'C+': 'img/toolbar-rating-c-plus@2x.png',
'C': 'img/toolbar-rating-c@2x.png',
'D': 'img/toolbar-rating-d@2x.png',
'A': 'img/toolbar-rating-a.svg',
'B+': 'img/toolbar-rating-b-plus.svg',
'B': 'img/toolbar-rating-b.svg',
'C+': 'img/toolbar-rating-c-plus.svg',
'C': 'img/toolbar-rating-c.svg',
'D': 'img/toolbar-rating-d.svg',
// we don't currently show the D- grade
'D-': 'img/toolbar-rating-d@2x.png',
'F': 'img/toolbar-rating-f@2x.png'
'D-': 'img/toolbar-rating-d.svg',
'F': 'img/toolbar-rating-f.svg'
}

const Site = require('./site.es6')
Expand Down
3 changes: 2 additions & 1 deletion shared/js/background/redirect.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ function handleRequest (requestData) {
* If request is a tracker, cancel the request
*/
if (window.chrome) {
chrome.runtime.sendMessage({'updateTabData': true})
// this can send an error message when the popup is not open. check lastError to hide it
chrome.runtime.sendMessage({'updateTabData': true}, () => chrome.runtime.lastError)
}

var tracker = trackers.isTracker(requestData.url, thisTab, requestData)
Expand Down

0 comments on commit db503a5

Please sign in to comment.