Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Regional adblock #4489

Merged
merged 3 commits into from
Oct 4, 2016
Merged

Regional adblock #4489

merged 3 commits into from
Oct 4, 2016

Conversation

bbondy
Copy link
Member

@bbondy bbondy commented Oct 4, 2016

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).

Test Plan:

@bbondy bbondy added this to the 0.12.4dev milestone Oct 4, 2016
@bbondy
Copy link
Member Author

bbondy commented Oct 4, 2016

@bsclifton will review and I'll do changes in a follow up.

@bbondy bbondy merged commit 18fa206 into master Oct 4, 2016
@@ -10,6 +10,18 @@ const ABPFilterParser = ABPFilterParserLib.ABPFilterParser
const FilterOptions = ABPFilterParserLib.FilterOptions
const DataFile = require('./dataFile')
const Filtering = require('./filtering')
const appConfig = require('../js/constants/appConfig')
const debounce = require('../js/lib/debounce.js')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gotta drop the .js 😄

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doh that was from copy/paste, I'll get rid of all files at once when I fix this to avoid that

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -31,6 +31,7 @@ const app = electron.app
const uuid = require('node-uuid')
const path = require('path')
const getOrigin = require('../js/state/siteUtil').getOrigin
const {adBlockResourceName} = require('./adBlock')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small style question- our project has a mix of:

  • destructuring assignments with and without spaces around the item(s) (see line 34)
  • including using require and then referencing the method name (see line 33)

Is there a preferred syntax?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Newer code mostly should use destructuring when possible and no space around { and }.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -571,7 +581,10 @@ module.exports.isResourceEnabled = (resourceName, url) => {
}

if ((resourceName === appConfig.resourceNames.ADBLOCK ||
resourceName === appConfig.resourceNames.TRACKING_PROTECTION)) {
appConfig[resourceName] &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was there before, but has unnecessary double parens
if((condition === value)) { }

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep it was probably there because at one point they mattered and then after a bugfix they were left behind. Fixed as part of:
ecc67f2

etag: string, // last downloaded data file etag
lastCheckVersion: string, // last checked data file version
lastCheckDate: number, // last checked data file date.getTime()
enabled: boolean, // Enable adblocking
enabled: boolean, // Enable the resoruce
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/resoruce/resource :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed as part of:
ecc67f2

/**
* Dispatches an event to the renderer process to register or deregister a datafile
*
* @param {rules} ABP filter syntax rule string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be a copy/paste thing, but are these comments right? to register or deregister? (looks like it's updating existing rules that are in place)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed as part of:
ecc67f2

@bsclifton
Copy link
Member

bsclifton commented Oct 4, 2016

LGTM 😄 great job w/ the tests ❤️

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants