These two functions simply return on HTTPS urls.

Remove the null HTTPS listeners, which significantly slows down
browsing as Chromium has to always invoke this extension.

Signed-off-by: Nick Semenkovich <semenko@alum.mit.edu>
The function "potentiallyApplicableRulesets" is hot, and its results are stable.

From profiling, this is *very* slow, and it's easy to see why. The calls look like:

     Loading www.nytimes.com ->
          Load every image (20+ images at graphics8.nytimes.com)
	       Call potentiallyApplicableRulesets every time
	       	    Return the same result every time :(

Let's use a simple LRU cache to store those results.

This adds the MIT-licensed LRU cache from: https://github.com/rsms/js-lru

The cache isn't persistent (it's in memory, not LocalStorage or elsewhere),
so we don't have to worry about stale data when the extension updates.

Signed-off-by: Nick Semenkovich <semenko@alum.mit.edu>
Fix logic error in my prior commit

I wasn't reading carefully enough -- adds some comments explaining why we're
listening on send/rcv in the first place.

Signed-off-by: Nick Semenkovich <semenko@alum.mit.edu>
Merge branch 'master' of https://git.torproject.org/https-everywhere
Clean up some tiny but annoying lint warnings

Some unused variables (and some forgotten ones).

Signed-off-by: Nick Semenkovich <semenko@alum.mit.edu>
Set a more sane default log level

Logging /alone/ takes 50%+ of HTTPS Everywhere's profile time in Chrome (!)

Chrome will log & buffer console.log() even when the console is closed.

This means that for 99.9% of users (who never open the console), Chrome wastes
staggering amounts of time logging and buffering extremely verbose data.

For now, this just sets a default log level and includes adds the .warn() function.

TODO (Upcoming commit): Add a UI element to change the default log level.

Developers can simply type (in the console): DEFAULT_LOG_LEVEL=1;

Signed-off-by: Nick Semenkovich <semenko@alum.mit.edu>
Merge pull request #15 from semenko/stop-listening

Fix logic error in my prior commit
Merge pull request #16 from semenko/syntax-cleanups

Nit: Clean up some tiny but annoying lint warnings
Merge pull request #17 from semenko/log-less

Set a more sane default log level
Merge remote-tracking branch 'origin/master'
Merge branch 'cache-rulesets' of github.com:semenko/https-everywhere into semenko-cache-rulesets

Conflicts:
	chromium/rules.js
Add MIT license note
Installable in Fennec and Firefox Mobile for Android!

(no UI yet...)
Merge branch 'master' of https://git.torproject.org/https-everywhere
[Numergy] Added ruleset.
[WeChat] Don't force !www

And remove outdated comment.
[QQ] Fix
[BMI] Added ruleset.
For the time being, this is blocking on UI work.

This reverts commit 9afcb8e5242946a4f43b74434d6050182a2752fb.
Merge remote-tracking branch 'jpds/bmi-ruleset'