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

Commit

Permalink
Merge tag '1.9.7b1'
Browse files Browse the repository at this point in the history
  • Loading branch information
nicole-ashley committed Sep 13, 2016
2 parents 0bdba85 + b940050 commit 5862eb1
Show file tree
Hide file tree
Showing 24 changed files with 820 additions and 676 deletions.
3 changes: 2 additions & 1 deletion platform/chromium/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,

"name": "uBlock Origin",
"version": "1.9.6",
"version": "1.9.7.1",

"default_locale": "en",
"description": "__MSG_extShortDesc__",
Expand Down Expand Up @@ -40,6 +40,7 @@
],
"incognito": "split",
"minimum_chrome_version": "26.0",
"optional_permissions": [ "file:///*" ],
"options_page": "dashboard.html",
"options_ui": {
"page": "options_ui.html"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*******************************************************************************
uBlock Origin - a browser extension to block requests.
Copyright (C) 2015 Raymond Hill
Copyright (C) 2014-2016 The uBlock Origin authors
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -19,12 +19,11 @@
Home: https://github.com/gorhill/uBlock
*/

/******************************************************************************/

(function() {
// For background page or non-background pages

'use strict';

/******************************************************************************/
/******************************************************************************/

// https://github.com/gorhill/uBlock/issues/1067
Expand All @@ -40,6 +39,8 @@ if ( String.prototype.startsWith instanceof Function === false ) {
};
}

/******************************************************************************/

// https://github.com/gorhill/uBlock/issues/1067
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith
// Firefox 17/Chromium 41 supports `endsWith`.
Expand All @@ -61,35 +62,68 @@ if ( String.prototype.endsWith instanceof Function === false ) {
// This polyfill is designed to fulfill *only* what uBlock Origin needs -- this
// is not an accurate API of the real Set() type.

if ( typeof self.Set !== 'function' ) {
self.Set = function() {
if ( self.Set instanceof Function === false ) {
self.Set = function(iter) {
this.clear();
if ( Array.isArray(iter) ) {
for ( var i = 0, n = iter.length; i < n; i++ ) {
this.add(iter[i]);
}
return;
}
};

self.Set.polyfill = true;

self.Set.prototype.clear = function() {
this._set = Object.create(null);
this.size = 0;
// Iterator stuff
this._values = undefined;
this._i = undefined;
this.value = undefined;
this.done = true;
};

self.Set.prototype.add = function(k) {
if ( this._set[k] === undefined ) {
this._set[k] = true;
this.size += 1;
}
return this;
};

self.Set.prototype.delete = function(k) {
if ( this._set[k] !== undefined ) {
delete this._set[k];
this.size -= 1;
return true;
}
return false;
};

self.Set.prototype.has = function(k) {
return this._set[k] !== undefined;
};

self.Set.prototype.next = function() {
if ( this._i < this.size ) {
this.value = this._values[this._i++];
} else {
this._values = undefined;
this.value = undefined;
this.done = true;
}
return this;
};

self.Set.prototype.values = function() {
this._values = Object.keys(this._set);
this._i = 0;
this.value = undefined;
this.done = false;
return this;
};
}

/******************************************************************************/
Expand All @@ -99,23 +133,45 @@ if ( typeof self.Set !== 'function' ) {
// This polyfill is designed to fulfill *only* what uBlock Origin needs -- this
// is not an accurate API of the real Map() type.

if ( typeof self.Map !== 'function' ) {
self.Map = function() {
if ( self.Map instanceof Function === false ) {
self.Map = function(iter) {
this.clear();
if ( Array.isArray(iter) ) {
for ( var i = 0, n = iter.length, entry; i < n; i++ ) {
entry = iter[i];
this.set(entry[0], entry[1]);
}
return;
}
};

self.Map.polyfill = true;

self.Map.prototype.clear = function() {
this._map = Object.create(null);
this.size = 0;
// Iterator stuff
this._keys = undefined;
this._i = undefined;
this.value = undefined;
this.done = true;
};

self.Map.prototype.delete = function(k) {
if ( this._map[k] !== undefined ) {
delete this._map[k];
this.size -= 1;
return true;
}
return false;
};

self.Map.prototype.entries = function() {
this._keys = Object.keys(this._map);
this._i = 0;
this.value = [ undefined, undefined ];
this.done = false;
return this;
};

self.Map.prototype.get = function(k) {
Expand All @@ -126,6 +182,19 @@ if ( typeof self.Map !== 'function' ) {
return this._map[k] !== undefined;
};

self.Map.prototype.next = function() {
if ( this._i < this.size ) {
var key = this._keys[this._i++];
this.value[0] = key;
this.value[1] = this._map[key];
} else {
this._keys = undefined;
this.value = undefined;
this.done = true;
}
return this;
};

self.Map.prototype.set = function(k, v) {
if ( v !== undefined ) {
if ( this._map[k] === undefined ) {
Expand All @@ -138,9 +207,8 @@ if ( typeof self.Map !== 'function' ) {
}
delete this._map[k];
}
return this;
};
}

/******************************************************************************/

})();
8 changes: 3 additions & 5 deletions platform/chromium/vapi-common.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*******************************************************************************
µBlock - a browser extension to block requests.
Copyright (C) 2014 The µBlock authors
uBlock Origin - a browser extension to block requests.
Copyright (C) 2014-2016 The uBlock Origin authors
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -21,15 +21,13 @@

// For background page or non-background pages

/* global self */
'use strict';

/******************************************************************************/
/******************************************************************************/

(function() {

'use strict';

var vAPI = self.vAPI = self.vAPI || {};
var chrome = self.chrome;

Expand Down
3 changes: 2 additions & 1 deletion platform/edge/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,

"name": "uBlock Origin",
"version": "1.9.6",
"version": "1.9.7.1",

"default_locale": "en",
"description": "__MSG_extShortDesc__",
Expand Down Expand Up @@ -41,6 +41,7 @@
],
"incognito": "split",
"minimum_edge_version": "38.14393",
"optional_permissions": [ "file:///*" ],
"options_page": "dashboard.html",
"options_ui": {
"page": "options_ui.html"
Expand Down
Loading

0 comments on commit 5862eb1

Please sign in to comment.