From ee08985f3bbf56ad8fda61c7370b6b37e1bbbe16 Mon Sep 17 00:00:00 2001 From: Ruben Rodriguez Date: Sat, 10 Oct 2015 11:26:00 -0500 Subject: LibreJS updated to 6.0.10.20150620 --- .../html_script_finder/web_labels/js_web_labels.js | 25 +++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'data/extensions/jid1-KtlZuoiikVfFew@jetpack/resources/librejs/lib/html_script_finder') diff --git a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/resources/librejs/lib/html_script_finder/web_labels/js_web_labels.js b/data/extensions/jid1-KtlZuoiikVfFew@jetpack/resources/librejs/lib/html_script_finder/web_labels/js_web_labels.js index ab363d9..510852b 100644 --- a/data/extensions/jid1-KtlZuoiikVfFew@jetpack/resources/librejs/lib/html_script_finder/web_labels/js_web_labels.js +++ b/data/extensions/jid1-KtlZuoiikVfFew@jetpack/resources/librejs/lib/html_script_finder/web_labels/js_web_labels.js @@ -124,7 +124,8 @@ WebLabelFinder.prototype.formatURL = function(link) { WebLabelFinder.prototype.fetchLicensePage = function() { var that = this; try { - var req = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(); + var req = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"] + .createInstance(); req.onload = function() { console.debug("Fetching License!"); @@ -173,6 +174,26 @@ WebLabelFinder.prototype.isLicenseFree = function( var license; var found = false; + // Check if we can look up this license by its identifier. + var identifier = lic.licenses[i]['licenseName']; + if (typeof identifier !== 'undefined' && + typeof licenses[identifier] !== 'undefined' + ) { + console.debug('recognized by index', identifier); + // This license was recognized, and it was free. Add it + // to the array of license status, which we'll look at + // when we're done with this web label row. + licenseStatuses.push(true); + + console.debug("about TO ADD TO XHR: ", lic.fileUrl); + this.listCheck[lic.fileUrl] = 0; + addToCache(lic, 0, jslicenseURL, callback); + + // Break out of the loop cause we found a matching license. + found = true; + continue; + } + // For each license from the internal license definitions for (license in licenses) { if (found === true) { @@ -262,8 +283,6 @@ WebLabelFinder.prototype.matchListWithDefs = function(jslicenseURL) { } }, 15000); - - for (var i = 0; i < this.licenseList.length; i++) { // this.licenseList[i] is the web labels license column var lic = this.licenseList[i]; -- cgit v1.2.3