Opened 3 years ago

Last modified 20 months ago

#5502 in_progress defect

Does not work with LibreJS

Reported by: CharlieBrown Owned by: Andreas Nilsson
Priority: major Milestone:
Component: graphic design/interface Keywords: LibreJS, JavaScript
Cc: Parent Tickets:

Description

GNU MediaGoblin does not work with GNU LibreJS.

There was no "JavaScript license information" link on the GNU MediaGoblin page, so I coludn't manually check it.

Subtickets

Attachments (1)

librejs.info (41.5 KB) - added by Andreas Nilsson 20 months ago.
Documentation

Download all attachments as: .zip

Change History (3)

Changed 20 months ago by Andreas Nilsson

Attachment: librejs.info added

Documentation

comment:1 Changed 20 months ago by Andreas Nilsson

5 JavaScript Detection

LibreJS considers a very strict subset of JavaScript to be acceptable
for use in non-free scripts. This is meant to maximimize compatibility
with websites that haven't tried to be LibreJS compatible.

We consider modification of the document non-trivial. There isn't

much that javascript could do that we would consider trivial, for
anything else a free software license would be required.

The criterion is as follows:

For each function definition:

  • It must call only primitives.
  • The number of conditionals and loops must be at most 3.
  • It does not declare an array more than 50 elements long.
  • It must not call itself

For the rest of the script, outside of function definitions:

  • It must call only primitives and functions defined above in the page.
  • The number of conditionals and loops must be at most 3.

"function" means anything executable that gets a name, including

methods.

Allowed primitives exclude:

  • eval()
  • ajax
  • calling methods with the square bracket notation
  • altering the dom
  • most other items found as methods of the '.window' object.


File: librejs.info, Node: Free Licenses Detection, Next: Setting Your JavaScript Free, Prev: JavaScript Detection, Up: Top

6 Free Licenses Detection
*

The machine readable format for license declarations that LibreJS uses
has changed in the most recent version. This was necessary in order to
not break the asynchronous JS loading model that browsers use. Scripts
are now evaluated independent of eachother and strictly as they arrive.


File: librejs.info, Node: Setting Your JavaScript Free, Next: LibreJS Development Notes, Prev: Free Licenses Detection, Up: Top

7 Setting Your JavaScript Free

The first step is releasing your JavaScript under a free license. If
you are already using a free library, or you're not using any
third-party libraries, it might only take a few minutes.

On your website, take a look at your HTML source. You can identify

distinct pieces of JavaScript that might be free and some other that are
nonfree.

This might be the case with an analytics tracker, social media

widgets, and code that runs ads. Removing these pieces of code from
your site is required to have the rest accepted as free. There are
often alternatives to nonfree libraries or to third-party services:

  • If you have used nonfree third-party code as the base to write your own code, try to find a free alternative.
  • If you're using a third-party service such as an analytics service, replace it with a free alternative like Piwik.
  • If you can't find free JavaScript that has already been developed, write it yourself! Who knows, your own solution might be the start of a brilliant project!

7.1 License tags
================

LibreJS will allow non-trivial scripts to run as long as they use a free
license.

In order for the license of a script to be recognized by LibreJS, it

must be declared using a machine-readable license format.

This format is the same for both remote in-line scripts.

" @license [magnet link] [identifier]" [Script here] "

@license-end"

"Identifier" is a name of a license from the following list and

"magnet link" is that license's exact corresponding magnet link.

{

'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':{

'URL': 'http://www.perlfoundation.org/artistic_license_2_0',
'Magnet link': 'magnet:?xt=urn:btih:54fd2283f9dbdf29466d2df1a98bf8f65cafe314&dn=artistic-2.0.txt'

},
'Boost':{

'URL': 'http://www.boost.org/LICENSE_1_0.txt',
'Magnet link': 'magnet:?xt=urn:btih:89a97c535628232f2f3888c2b7b8ffd4c078cec0&dn=Boost-1.0.txt'

},
'BSD-3-Clause':{

'URL': 'http://opensource.org/licenses/BSD-3-Clause',
'Magnet link': 'magnet:?xt=urn:btih:c80d50af7d3db9be66a4d0a86db0286e4fd33292&dn=bsd-3-clause.txt',

},
'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':{

'URL': 'http://creativecommons.org/publicdomain/zero/1.0/legalcode',
'Magnet link': 'magnet:?xt=urn:btih:90dc5c0be029de84e523b9b3922520e79e0e6f08&dn=cc0.txt'

},
'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':{

'URL': 'http://www.jclark.com/xml/copying.txt',
'Magnet link': 'magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt'

},
'FreeBSD':{

'URL': 'http://www.freebsd.org/copyright/freebsd-license.html',
'Magnet link': 'magnet:?xt=urn:btih:87f119ba0b429ba17a44b4bffcab33165ebdacc0&dn=freebsd.txt'

},
'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':{

'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':{

'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':{

'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':{

'URL': 'http://www.gnu.org/licenses/agpl-3.0.html',
'Magnet link': 'magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt'

},
'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':{

'URL': 'http://www.mozilla.org/MPL/2.0',
'Magnet link': 'magnet:?xt=urn:btih:3877d6d54b3accd4bc32f8a48bf32ebc0901502a&dn=mpl-2.0.txt'

},
'UPL-1.0': {

'URL': 'https://oss.oracle.com/licenses/upl/',
'Magnet link': 'magnet:?xt=urn:btih:478974f4d41c3fa84c4befba25f283527fad107d&dn=upl-1.0.txt'

},
'WTFPL': {

'URL': 'http://www.wtfpl.net/txt/copying/',
'Magnet link': 'magnet:?xt=urn:btih:723febf9f6185544f57f0660a41489c7d6b4931b&dn=wtfpl.txt'

},
'Unlicense':{

'URL': 'http://unlicense.org/UNLICENSE',
'Magnet link': 'magnet:?xt=urn:btih:5ac446d35272cc2e4e85e4325b146d0b7ca8f50c&dn=unlicense.txt'

},
'X11':{

'URL': 'http://www.xfree86.org/3.3.6/COPYRIGHT2.html#3',
'Magnet link': 'magnet:?xt=urn:btih:5305d91886084f776adcf57509a648432709a7c7&dn=x11.txt'

},
'Modified-BSD':{

'URL': 'http://www.xfree86.org/current/LICENSE4.html',
'Magnet link': 'magnet:?xt=urn:btih:12f2ec9e8de2a3b0002a33d518d6010cc8ab2ae9&dn=xfree86.txt'

}

}

comment:2 Changed 20 months ago by Andreas Nilsson

Owner: set to Andreas Nilsson
Status: newin_progress
Note: See TracTickets for help on using tickets.