aboutsummaryrefslogtreecommitdiff
path: root/README
blob: 14a2d831b4afb2050d519493c2010ea98338ca28 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
## LibreJS - WebExtensions Edition ##


BUILD:

First, you need to get some stuff with npm:
  $ npm install acorn-loose
  $ npm install jssha
  $ npm install browserify
  $ export PATH=$PATH:./node_modules/.bin

To build the extension run:
  $ browserify main_background.js -o bundle.js

To build the extension plus create a .xpi package run:
  $ ./build.sh

To build the extension including the automated test suite (see TEST below) run:
  $ ./build.sh -t
  or
  $ ./build.sh --test

Note: this build.sh script relies on no new source files being created.


DEBUG:

To debug this add-on on IceCat and other Firefox derivatives, browse to the special URL "about:debugging", select "Enable add-on debugging", and load the manifest.json in this directory with the "Load Temporary Add-on" button.

LibreJS should work with other WebExtensions-compliant browsers; but currently, none of them meet the freedom standards of GNU, so no help will be provided for their usage.


TEST:

An automated test suite runs automatically in its own tab whenever the extension
is loaded as a "temporary add-on" from about:debugging.
Otherwise (if included in the xpi, see BUILD above) it can be launched from the
UI by clicking the [Automated self test...] button.


HEADLESS TESTS:

To launch the test suite from the command line, ensure the extension
has been built with automated test suite. Then install
selenium-webdriver and geckodriver, and ensure the latter is in $PATH:

  $ npm install selenium-webdriver
  $ npm install geckodriver
  $ export PATH=$PATH:./node_modules/.bin

Now you can invoke the test with

  $ node ./test.js

which will print out a summary of test results.

Optionally you can also test with a chosen seed

  $ node ./test.js 12345


HEADLESS COMPLIANCE CHECK:

To check whether a webpage is LibreJS-compliant from the command line, ensure that the extension has NOT been built with automated test suite. Then install selenium-webdriver and geckodriver, and ensure the latter is in $PATH:

  $ npm install selenium-webdriver
  $ npm install geckodriver
  $ export PATH=$PATH:./node_modules/.bin

Now you can check a webpage for compliance with

  $ node ./compliance.js <url>

It will open the url in a headless browser, save a screenshot, and output the compliance check result.

For example, to check the compliance of the FSF homepage, do

  $ node ./compliance.js https://fsf.org


CONTACT:

Development mailing list: bug-librejs@gnu.org
Users mailing list:       help-librejs@gnu.org
Subscribe URL:            https://savannah.gnu.org/mail/?group=librejs
Bug Reports:              https://savannah.gnu.org/bugs/?group=librejs