#51 Make LibreJS buildable and fix an infinite loop
Merged 2 years ago by ycp. Opened 2 years ago by stcg.
stcg/librejs master  into  master

file modified
+6 -6
@@ -103,7 +103,7 @@ 

    * modify the rendered HTML but rather feed the content script on demand.

    * Returns true if the document has been actually modified, false otherwise.

    */

-   optimizeDocument(document, cachePointer) {

+   optimizeDocument(doc, cachePointer) {

      let cache = {};

      let {tabId, frameId, documentUrl} = cachePointer;

      let frameCache = cachedHrefs.get(tabId);
@@ -112,20 +112,20 @@ 

      }

      frameCache.set(frameId, new Map([[documentUrl, cache]]));

  

-     let link = document.querySelector(`link[rel="jslicense"], link[data-jslicense="1"], a[rel="jslicense"], a[data-jslicense="1"]`);

+     let link = doc.querySelector(`link[rel="jslicense"], link[data-jslicense="1"], a[rel="jslicense"], a[data-jslicense="1"]`);

      if (link) {

        let href = link.getAttribute("href");

        cache.webLabels = {href};

-       let move = () => !!document.head.insertBefore(link, document.head.firstChild);

-       if (link.parentNode === document.head) {

-         for (let node; node = link.previousElementSibling;) {

+       let move = () => !!doc.head.insertBefore(link, doc.head.firstChild);

+       if (link.parentNode === doc.head) {

+         for (let node = link; node = node.previousElementSibling;) {

            if (node.tagName.toUpperCase() === "SCRIPT") {

              return move();

            }

          }

        } else { // the reference is only in the body

          if (link.tagName.toUpperCase() === "A") {

-           let newLink = document.createElement("link");

+           let newLink = doc.createElement("link");

            newLink.rel = "jslicense";

            newLink.setAttribute("href", href);

            link = newLink;

file modified
+3 -3
@@ -1,5 +1,5 @@ 

- module.exports = {

- 	fname_data : {

+ {

+ 	"fname_data": {

  		"WebGLShader": true,

  		"WebGLShaderPrecisionFormat": true,

  		"WebGLQuery": true,
@@ -829,4 +829,4 @@ 

  		"NodeList": true,

  		"StopIteration": true

  	}

- };

+ }

file modified
+217 -217
@@ -1,219 +1,219 @@ 

- module.exports = {	

- 	licenses: {

- 		'Apache-2.0':{

- 			'Name': 'Apache 2.0',

- 			'URL': 'http://www.apache.org/licenses/LICENSE-2.0',

- 			'Magnet link': 'magnet:?xt=urn:btih:8e4f440f4c65981c5bf93c76d35135ba5064d8b7&dn=apache-2.0.txt'

- 		},

- 		'Artistic-2.0':{

- 			'Name': 'Artistic 2.0',

- 			'URL': 'http://www.perlfoundation.org/artistic_license_2_0',

- 			'Magnet link': 'magnet:?xt=urn:btih:54fd2283f9dbdf29466d2df1a98bf8f65cafe314&dn=artistic-2.0.txt'

- 		},

- 		'Boost':{

- 			'Name': 'Boost',

- 			'URL': 'http://www.boost.org/LICENSE_1_0.txt',

- 			'Magnet link': 'magnet:?xt=urn:btih:89a97c535628232f2f3888c2b7b8ffd4c078cec0&dn=Boost-1.0.txt'

- 		},

- 		'CPAL-1.0':{

- 			'Name': 'CPAL 1.0',

- 			'URL': 'http://opensource.org/licenses/cpal_1.0',

- 			'Magnet link': 'magnet:?xt=urn:btih:84143bc45939fc8fa42921d619a95462c2031c5c&dn=cpal-1.0.txt'

- 		},

- 		'CC0-1.0':{

- 			'Name': 'CC0 1.0',

- 			'URL': 'http://creativecommons.org/publicdomain/zero/1.0/legalcode',

- 			'Magnet link': 'magnet:?xt=urn:btih:90dc5c0be029de84e523b9b3922520e79e0e6f08&dn=cc0.txt'

- 		},

- 		'CC-BY-SA-1.0':{

- 			'Name': 'CC-BY-SA 1.0',

- 			'URL': 'https://creativecommons.org/licenses/by-sa/1.0/',

- 			'Magnet link': ''

- 		},

- 		'CC-BY-SA-2.0':{

- 			'Name': 'CC-BY-SA 2.0',

- 			'URL': 'https://creativecommons.org/licenses/by-sa/2.0/',

- 			'Magnet link': ''

- 		},

- 		'CC-BY-SA-2.5':{

- 			'Name': 'CC-BY-SA 2.5',

- 			'URL': 'https://creativecommons.org/licenses/by-sa/2.5/',

- 			'Magnet link': ''

- 		},

- 		'CC-BY-SA-3.0':{

- 			'Name': 'CC-BY-SA 3.0',

- 			'URL': 'https://creativecommons.org/licenses/by-sa/3.0/',

- 			'Magnet link': ''

- 		},

- 		'CC-BY-SA-4.0':{

- 			'Name': 'CC-BY-SA 4.0',

- 			'URL': 'https://creativecommons.org/licenses/by-sa/4.0/',

- 			'Magnet link': ''

- 		},

- 		'CC-BY-1.0':{

- 			'Name': 'CC-BY 1.0',

- 			'URL': 'https://creativecommons.org/licenses/by/1.0/',

- 			'Magnet link': ''

- 		},

- 		'CC-BY-2.0':{

- 			'Name': 'CC-BY 2.0',

- 			'URL': 'https://creativecommons.org/licenses/by/2.0/',

- 			'Magnet link': ''

- 		},

- 		'CC-BY-2.5':{

- 			'Name': 'CC-BY 2.5',

- 			'URL': 'https://creativecommons.org/licenses/by/2.5/',

- 			'Magnet link': ''

- 		},

- 		'CC-BY-3.0':{

- 			'Name': 'CC-BY 3.0',

- 			'URL': 'https://creativecommons.org/licenses/by/3.0/',

- 			'Magnet link': ''

- 		},

- 		'CC-BY-4.0':{

- 			'Name': 'CC-BY 4.0',

- 			'URL': 'https://creativecommons.org/licenses/by/4.0/',

- 			'Magnet link': ''

- 		},

- 		'EPL-1.0':{

- 			'Name': 'EPL 1.0',

- 			'URL': 'http://www.eclipse.org/legal/epl-v10.html',

- 			'Magnet link': 'magnet:?xt=urn:btih:4c6a2ad0018cd461e9b0fc44e1b340d2c1828b22&dn=epl-1.0.txt'

- 		},

- 		'Expat':{

- 			'Name': 'Expat',

- 			'URL': 'http://www.jclark.com/xml/copying.txt',

- 			'Magnet link': 'magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt'

- 		},

- 		'MIT':{

- 			'Name': 'Expat',

- 			'URL': 'http://www.jclark.com/xml/copying.txt',

- 			'Magnet link': 'magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt'

- 		},

- 		'X11':{

- 			'Name': 'X11',

- 			'URL': 'http://www.xfree86.org/3.3.6/COPYRIGHT2.html#3',

- 			'Magnet link': 'magnet:?xt=urn:btih:5305d91886084f776adcf57509a648432709a7c7&dn=x11.txt'	

- 		},

- 		'GPL-2.0':{

- 			'Name': 'GPL 2.0',

- 			'URL': 'http://www.gnu.org/licenses/gpl-2.0.html',

- 			'Magnet link': 'magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt'

- 		},

- 		'GPL-3.0':{

- 			'Name': 'GPL 3.0',

- 			'URL': 'http://www.gnu.org/licenses/gpl-3.0.html',

- 			'Magnet link': 'magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt'

- 		},

- 		'LGPL-2.1':{

- 			'Name': 'LGPL 2.1',

- 			'URL': 'http://www.gnu.org/licenses/lgpl-2.1.html',

- 			'Magnet link': 'magnet:?xt=urn:btih:5de60da917303dbfad4f93fb1b985ced5a89eac2&dn=lgpl-2.1.txt'

- 		},

- 		'LGPL-3.0':{

- 			'Name': 'LGPL 3.0',

- 			'URL': 'http://www.gnu.org/licenses/lgpl-3.0.html',

- 			'Magnet link': 'magnet:?xt=urn:btih:0ef1b8170b3b615170ff270def6427c317705f85&dn=lgpl-3.0.txt'

- 		},

- 		'AGPL-3.0':{

- 			'Name': 'AGPL 3.0',

- 			'URL': 'http://www.gnu.org/licenses/agpl-3.0.html',

- 			'Magnet link': 'magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt'

- 		},

- 		'GPL-2.0-only':{

- 			'Name': 'GPL 2.0',

- 			'URL': 'http://www.gnu.org/licenses/gpl-2.0.html',

- 			'Magnet link': ''

- 		},

- 		'GPL-3.0-only':{

- 			'Name': 'GPL 3.0',

- 			'URL': 'http://www.gnu.org/licenses/gpl-3.0.html',

- 			'Magnet link': ''

- 		},

- 		'LGPL-2.1-only':{

- 			'Name': 'LGPL 2.1',

- 			'URL': 'http://www.gnu.org/licenses/lgpl-2.1.html',

- 			'Magnet link': ''

- 		},

- 		'LGPL-3.0-only':{

- 			'Name': 'LGPL 3.0',

- 			'URL': 'http://www.gnu.org/licenses/lgpl-3.0.html',

- 			'Magnet link': ''

- 		},

- 		'AGPL-3.0-only':{

- 			'Name': 'AGPL 3.0',

- 			'URL': 'http://www.gnu.org/licenses/agpl-3.0.html',

- 			'Magnet link': ''

- 		},

- 		'GPL-2.0-or-later':{

- 			'Name': 'GPL 2.0 or later',

- 			'URL': 'http://www.gnu.org/licenses/gpl-2.0.html',

- 			'Magnet link': 'magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt'

- 		},

- 		'GPL-3.0-or-later':{

- 			'Name': 'GPL 3.0 or later',

- 			'URL': 'http://www.gnu.org/licenses/gpl-3.0.html',

- 			'Magnet link': 'magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt'

- 		},

- 		'LGPL-2.1-or-later':{

- 			'Name': 'LGPL 2.1 or later',

- 			'URL': 'http://www.gnu.org/licenses/lgpl-2.1.html',

- 			'Magnet link': 'magnet:?xt=urn:btih:5de60da917303dbfad4f93fb1b985ced5a89eac2&dn=lgpl-2.1.txt'

- 		},

- 		'LGPL-3.0-or-later':{

- 			'Name': 'LGPL 3.0 or later',

- 			'URL': 'http://www.gnu.org/licenses/lgpl-3.0.html',

- 			'Magnet link': 'magnet:?xt=urn:btih:0ef1b8170b3b615170ff270def6427c317705f85&dn=lgpl-3.0.txt'

- 		},

- 		'AGPL-3.0-or-later':{

- 			'Name': 'AGPL 3.0 or later',

- 			'URL': 'http://www.gnu.org/licenses/agpl-3.0.html',

- 			'Magnet link': 'magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt'

- 		},

- 		'ISC':{

- 			'Name': 'ISC',

- 			'URL': 'https://www.isc.org/downloads/software-support-policy/isc-license/',

- 			'Magnet link': 'magnet:?xt=urn:btih:b8999bbaf509c08d127678643c515b9ab0836bae&dn=ISC.txt'

- 		},

- 		'MPL-2.0':{

- 			'Name': 'MPL 2.0',

- 			'URL': 'http://www.mozilla.org/MPL/2.0',

- 			'Magnet link': 'magnet:?xt=urn:btih:3877d6d54b3accd4bc32f8a48bf32ebc0901502a&dn=mpl-2.0.txt'

- 		},

- 		'UPL-1.0': {

- 			'Name': 'UPL 1.0',

- 			'URL': 'https://oss.oracle.com/licenses/upl/',

- 			'Magnet link': 'magnet:?xt=urn:btih:478974f4d41c3fa84c4befba25f283527fad107d&dn=upl-1.0.txt'

- 		},

- 		'WTFPL': {

- 			'Name': 'WTFPL',

- 			'URL': 'http://www.wtfpl.net/txt/copying/',

- 			'Magnet link': 'magnet:?xt=urn:btih:723febf9f6185544f57f0660a41489c7d6b4931b&dn=wtfpl.txt'

- 		},

- 		'Unlicense':{

- 			'Name': 'Unlicense',

- 			'URL': 'http://unlicense.org/UNLICENSE',

- 			'Magnet link': 'magnet:?xt=urn:btih:5ac446d35272cc2e4e85e4325b146d0b7ca8f50c&dn=unlicense.txt'

- 		},

- 		'FreeBSD':{

- 			'Name': 'FreeBSD',

- 			'URL': 'http://www.freebsd.org/copyright/freebsd-license.html',

- 			'Magnet link': 'magnet:?xt=urn:btih:87f119ba0b429ba17a44b4bffcab33165ebdacc0&dn=freebsd.txt'

- 		},

- 		'BSD-2-Clause':{

- 			'Name': 'FreeBSD (BSD-2-Clause)',

- 			'URL': 'http://www.freebsd.org/copyright/freebsd-license.html',

- 			'Magnet link': ''

- 		},

- 		'BSD-3-Clause':{

- 			'Name': 'Modified BSD (BSD-3-Clause)',

- 			'URL': 'http://opensource.org/licenses/BSD-3-Clause',

- 			'Magnet link': 'magnet:?xt=urn:btih:c80d50af7d3db9be66a4d0a86db0286e4fd33292&dn=bsd-3-clause.txt'

- 		},

- 		'XFree86-1.1':{

- 			'Name': 'XFree86 1.1',

- 			'URL': 'http://www.xfree86.org/current/LICENSE4.html',

- 			'Magnet link': 'magnet:?xt=urn:btih:12f2ec9e8de2a3b0002a33d518d6010cc8ab2ae9&dn=xfree86.txt'

+ {	

+ 	"licenses": {

+ 		"Apache-2.0":{

+ 			"Name": "Apache 2.0",

+ 			"URL": "http://www.apache.org/licenses/LICENSE-2.0",

+ 			"Magnet link": "magnet:?xt=urn:btih:8e4f440f4c65981c5bf93c76d35135ba5064d8b7&dn=apache-2.0.txt"

+ 		},

+ 		"Artistic-2.0":{

+ 			"Name": "Artistic 2.0",

+ 			"URL": "http://www.perlfoundation.org/artistic_license_2_0",

+ 			"Magnet link": "magnet:?xt=urn:btih:54fd2283f9dbdf29466d2df1a98bf8f65cafe314&dn=artistic-2.0.txt"

+ 		},

+ 		"Boost":{

+ 			"Name": "Boost",

+ 			"URL": "http://www.boost.org/LICENSE_1_0.txt",

+ 			"Magnet link": "magnet:?xt=urn:btih:89a97c535628232f2f3888c2b7b8ffd4c078cec0&dn=Boost-1.0.txt"

+ 		},

+ 		"CPAL-1.0":{

+ 			"Name": "CPAL 1.0",

+ 			"URL": "http://opensource.org/licenses/cpal_1.0",

+ 			"Magnet link": "magnet:?xt=urn:btih:84143bc45939fc8fa42921d619a95462c2031c5c&dn=cpal-1.0.txt"

+ 		},

+ 		"CC0-1.0":{

+ 			"Name": "CC0 1.0",

+ 			"URL": "http://creativecommons.org/publicdomain/zero/1.0/legalcode",

+ 			"Magnet link": "magnet:?xt=urn:btih:90dc5c0be029de84e523b9b3922520e79e0e6f08&dn=cc0.txt"

+ 		},

+ 		"CC-BY-SA-1.0":{

+ 			"Name": "CC-BY-SA 1.0",

+ 			"URL": "https://creativecommons.org/licenses/by-sa/1.0/",

+ 			"Magnet link": ""

+ 		},

+ 		"CC-BY-SA-2.0":{

+ 			"Name": "CC-BY-SA 2.0",

+ 			"URL": "https://creativecommons.org/licenses/by-sa/2.0/",

+ 			"Magnet link": ""

+ 		},

+ 		"CC-BY-SA-2.5":{

+ 			"Name": "CC-BY-SA 2.5",

+ 			"URL": "https://creativecommons.org/licenses/by-sa/2.5/",

+ 			"Magnet link": ""

+ 		},

+ 		"CC-BY-SA-3.0":{

+ 			"Name": "CC-BY-SA 3.0",

+ 			"URL": "https://creativecommons.org/licenses/by-sa/3.0/",

+ 			"Magnet link": ""

+ 		},

+ 		"CC-BY-SA-4.0":{

+ 			"Name": "CC-BY-SA 4.0",

+ 			"URL": "https://creativecommons.org/licenses/by-sa/4.0/",

+ 			"Magnet link": ""

+ 		},

+ 		"CC-BY-1.0":{

+ 			"Name": "CC-BY 1.0",

+ 			"URL": "https://creativecommons.org/licenses/by/1.0/",

+ 			"Magnet link": ""

+ 		},

+ 		"CC-BY-2.0":{

+ 			"Name": "CC-BY 2.0",

+ 			"URL": "https://creativecommons.org/licenses/by/2.0/",

+ 			"Magnet link": ""

+ 		},

+ 		"CC-BY-2.5":{

+ 			"Name": "CC-BY 2.5",

+ 			"URL": "https://creativecommons.org/licenses/by/2.5/",

+ 			"Magnet link": ""

+ 		},

+ 		"CC-BY-3.0":{

+ 			"Name": "CC-BY 3.0",

+ 			"URL": "https://creativecommons.org/licenses/by/3.0/",

+ 			"Magnet link": ""

+ 		},

+ 		"CC-BY-4.0":{

+ 			"Name": "CC-BY 4.0",

+ 			"URL": "https://creativecommons.org/licenses/by/4.0/",

+ 			"Magnet link": ""

+ 		},

+ 		"EPL-1.0":{

+ 			"Name": "EPL 1.0",

+ 			"URL": "http://www.eclipse.org/legal/epl-v10.html",

+ 			"Magnet link": "magnet:?xt=urn:btih:4c6a2ad0018cd461e9b0fc44e1b340d2c1828b22&dn=epl-1.0.txt"

+ 		},

+ 		"Expat":{

+ 			"Name": "Expat",

+ 			"URL": "http://www.jclark.com/xml/copying.txt",

+ 			"Magnet link": "magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt"

+ 		},

+ 		"MIT":{

+ 			"Name": "Expat",

+ 			"URL": "http://www.jclark.com/xml/copying.txt",

+ 			"Magnet link": "magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt"

+ 		},

+ 		"X11":{

+ 			"Name": "X11",

+ 			"URL": "http://www.xfree86.org/3.3.6/COPYRIGHT2.html#3",

+ 			"Magnet link": "magnet:?xt=urn:btih:5305d91886084f776adcf57509a648432709a7c7&dn=x11.txt"	

+ 		},

+ 		"GPL-2.0":{

+ 			"Name": "GPL 2.0",

+ 			"URL": "http://www.gnu.org/licenses/gpl-2.0.html",

+ 			"Magnet link": "magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt"

+ 		},

+ 		"GPL-3.0":{

+ 			"Name": "GPL 3.0",

+ 			"URL": "http://www.gnu.org/licenses/gpl-3.0.html",

+ 			"Magnet link": "magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt"

+ 		},

+ 		"LGPL-2.1":{

+ 			"Name": "LGPL 2.1",

+ 			"URL": "http://www.gnu.org/licenses/lgpl-2.1.html",

+ 			"Magnet link": "magnet:?xt=urn:btih:5de60da917303dbfad4f93fb1b985ced5a89eac2&dn=lgpl-2.1.txt"

+ 		},

+ 		"LGPL-3.0":{

+ 			"Name": "LGPL 3.0",

+ 			"URL": "http://www.gnu.org/licenses/lgpl-3.0.html",

+ 			"Magnet link": "magnet:?xt=urn:btih:0ef1b8170b3b615170ff270def6427c317705f85&dn=lgpl-3.0.txt"

+ 		},

+ 		"AGPL-3.0":{

+ 			"Name": "AGPL 3.0",

+ 			"URL": "http://www.gnu.org/licenses/agpl-3.0.html",

+ 			"Magnet link": "magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt"

+ 		},

+ 		"GPL-2.0-only":{

+ 			"Name": "GPL 2.0",

+ 			"URL": "http://www.gnu.org/licenses/gpl-2.0.html",

+ 			"Magnet link": ""

+ 		},

+ 		"GPL-3.0-only":{

+ 			"Name": "GPL 3.0",

+ 			"URL": "http://www.gnu.org/licenses/gpl-3.0.html",

+ 			"Magnet link": ""

+ 		},

+ 		"LGPL-2.1-only":{

+ 			"Name": "LGPL 2.1",

+ 			"URL": "http://www.gnu.org/licenses/lgpl-2.1.html",

+ 			"Magnet link": ""

+ 		},

+ 		"LGPL-3.0-only":{

+ 			"Name": "LGPL 3.0",

+ 			"URL": "http://www.gnu.org/licenses/lgpl-3.0.html",

+ 			"Magnet link": ""

+ 		},

+ 		"AGPL-3.0-only":{

+ 			"Name": "AGPL 3.0",

+ 			"URL": "http://www.gnu.org/licenses/agpl-3.0.html",

+ 			"Magnet link": ""

+ 		},

+ 		"GPL-2.0-or-later":{

+ 			"Name": "GPL 2.0 or later",

+ 			"URL": "http://www.gnu.org/licenses/gpl-2.0.html",

+ 			"Magnet link": "magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt"

+ 		},

+ 		"GPL-3.0-or-later":{

+ 			"Name": "GPL 3.0 or later",

+ 			"URL": "http://www.gnu.org/licenses/gpl-3.0.html",

+ 			"Magnet link": "magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt"

+ 		},

+ 		"LGPL-2.1-or-later":{

+ 			"Name": "LGPL 2.1 or later",

+ 			"URL": "http://www.gnu.org/licenses/lgpl-2.1.html",

+ 			"Magnet link": "magnet:?xt=urn:btih:5de60da917303dbfad4f93fb1b985ced5a89eac2&dn=lgpl-2.1.txt"

+ 		},

+ 		"LGPL-3.0-or-later":{

+ 			"Name": "LGPL 3.0 or later",

+ 			"URL": "http://www.gnu.org/licenses/lgpl-3.0.html",

+ 			"Magnet link": "magnet:?xt=urn:btih:0ef1b8170b3b615170ff270def6427c317705f85&dn=lgpl-3.0.txt"

+ 		},

+ 		"AGPL-3.0-or-later":{

+ 			"Name": "AGPL 3.0 or later",

+ 			"URL": "http://www.gnu.org/licenses/agpl-3.0.html",

+ 			"Magnet link": "magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt"

+ 		},

+ 		"ISC":{

+ 			"Name": "ISC",

+ 			"URL": "https://www.isc.org/downloads/software-support-policy/isc-license/",

+ 			"Magnet link": "magnet:?xt=urn:btih:b8999bbaf509c08d127678643c515b9ab0836bae&dn=ISC.txt"

+ 		},

+ 		"MPL-2.0":{

+ 			"Name": "MPL 2.0",

+ 			"URL": "http://www.mozilla.org/MPL/2.0",

+ 			"Magnet link": "magnet:?xt=urn:btih:3877d6d54b3accd4bc32f8a48bf32ebc0901502a&dn=mpl-2.0.txt"

+ 		},

+ 		"UPL-1.0": {

+ 			"Name": "UPL 1.0",

+ 			"URL": "https://oss.oracle.com/licenses/upl/",

+ 			"Magnet link": "magnet:?xt=urn:btih:478974f4d41c3fa84c4befba25f283527fad107d&dn=upl-1.0.txt"

+ 		},

+ 		"WTFPL": {

+ 			"Name": "WTFPL",

+ 			"URL": "http://www.wtfpl.net/txt/copying/",

+ 			"Magnet link": "magnet:?xt=urn:btih:723febf9f6185544f57f0660a41489c7d6b4931b&dn=wtfpl.txt"

+ 		},

+ 		"Unlicense":{

+ 			"Name": "Unlicense",

+ 			"URL": "http://unlicense.org/UNLICENSE",

+ 			"Magnet link": "magnet:?xt=urn:btih:5ac446d35272cc2e4e85e4325b146d0b7ca8f50c&dn=unlicense.txt"

+ 		},

+ 		"FreeBSD":{

+ 			"Name": "FreeBSD",

+ 			"URL": "http://www.freebsd.org/copyright/freebsd-license.html",

+ 			"Magnet link": "magnet:?xt=urn:btih:87f119ba0b429ba17a44b4bffcab33165ebdacc0&dn=freebsd.txt"

+ 		},

+ 		"BSD-2-Clause":{

+ 			"Name": "FreeBSD (BSD-2-Clause)",

+ 			"URL": "http://www.freebsd.org/copyright/freebsd-license.html",

+ 			"Magnet link": ""

+ 		},

+ 		"BSD-3-Clause":{

+ 			"Name": "Modified BSD (BSD-3-Clause)",

+ 			"URL": "http://opensource.org/licenses/BSD-3-Clause",

+ 			"Magnet link": "magnet:?xt=urn:btih:c80d50af7d3db9be66a4d0a86db0286e4fd33292&dn=bsd-3-clause.txt"

+ 		},

+ 		"XFree86-1.1":{

+ 			"Name": "XFree86 1.1",

+ 			"URL": "http://www.xfree86.org/current/LICENSE4.html",

+ 			"Magnet link": "magnet:?xt=urn:btih:12f2ec9e8de2a3b0002a33d518d6010cc8ab2ae9&dn=xfree86.txt"

  		}

  	}

- };

+ }

Hi, I made some changes to LibreJS which I want to share.
Please read the commit log for details.

To verify that I did not change any license info in commit b781047, you may want to use the --word-diff-regex=. flag for git diff:

$ git diff --word-diff-regex=. b781047 b781047~1

That will show the exact character changed in that commit.

Hello,

I'm a new maintainer of LibreJS. Thanks for the PR and sorry for the late reply. The first two commits look good, and I will integrate them if no one else objects. I will test the third commit hopefully tomorrow.

The first commit is pushed https://lists.gnu.org/archive/html/bug-librejs/2021-11/msg00005.html.

I'm not sure about the third commit. I can see it prevents a nasty infinite loop, and it tests fine with lichess.org as well as the unit tests, but I can't tell whether the new logic could introduce any subtle bugs because I'm not that familiar with the code. I'll take another look later, maybe in a few days' time. @quidam can you also take a look?

I'm not sure about the third commit. I can see it prevents a nasty infinite loop, and it tests fine with lichess.org as well as the unit tests, but I can't tell whether the new logic could introduce any subtle bugs because I'm not that familiar with the code. I'll take another look later, maybe in a few days' time. @quidam can you also take a look?

I'm not really sure about it either, looking at it more closely seems like a good idea to me as well. In judging the third commit, my initial reasoning for it may help:

  1. I don't expect the change to break any previously working functionality. In the old code, the only case in which the loop did not repeat infinitely was when the node immediately preceding the link node was a script tag. In that exact case, the new code does the exact same thing. Namely, entering the if statement and doing the move().

  2. I think the new code adheres to the documentation of the optimizeDocument function. That documentation states:

    Moves external license references before any script in the page if needed, to have them ready when the first script load is triggered.

    The new code does that: it performs the move() if there exists a script node before the link node.

Thanks a lot for taking the time to explain this. I've pushed the changes to Savannah. I'll update this repo later.

These changes have been integrated, see https://pagure.io/librejs/commits/master. Thank you for contributing!

Pull-Request has been merged by ycp

2 years ago