mirror of https://github.com/gorhill/uBlock.git
comment review
This commit is contained in:
parent
9a622107ea
commit
a9a4c739a1
|
@ -280,6 +280,8 @@ var cachedAssetsManager = (function() {
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
var getTextFileFromURL = function(url, onLoad, onError) {
|
var getTextFileFromURL = function(url, onLoad, onError) {
|
||||||
|
// console.log('µBlock.assets/getTextFileFromURL("%s"):', url);
|
||||||
|
|
||||||
// https://github.com/gorhill/uMatrix/issues/15
|
// https://github.com/gorhill/uMatrix/issues/15
|
||||||
var onResponseReceived = function() {
|
var onResponseReceived = function() {
|
||||||
this.onload = this.onerror = this.ontimeout = null;
|
this.onload = this.onerror = this.ontimeout = null;
|
||||||
|
@ -301,11 +303,15 @@ var getTextFileFromURL = function(url, onLoad, onError) {
|
||||||
}
|
}
|
||||||
return onLoad.call(this);
|
return onLoad.call(this);
|
||||||
};
|
};
|
||||||
|
|
||||||
var onErrorReceived = function() {
|
var onErrorReceived = function() {
|
||||||
this.onload = this.onerror = this.ontimeout = null;
|
this.onload = this.onerror = this.ontimeout = null;
|
||||||
onError.call(this);
|
onError.call(this);
|
||||||
};
|
};
|
||||||
// console.log('µBlock> getTextFileFromURL("%s"):', url);
|
|
||||||
|
// Be ready for thrown exceptions:
|
||||||
|
// I am pretty sure it used to work, but now using a URL such as
|
||||||
|
// `file:///` on Chromium 40 results in an exception being thrown.
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
try {
|
try {
|
||||||
xhr.open('get', url, true);
|
xhr.open('get', url, true);
|
||||||
|
|
Loading…
Reference in New Issue