]>
Commit | Line | Data |
---|---|---|
02bc8bc5 RBR |
1 | # Junction |
2 | ||
bab26a4d | 3 | Connect people through any URL. |
1ed219c8 | 4 | |
bab26a4d RBR |
5 | Junction is a web extension for Firefox, Chrome and Safari that lets you start |
6 | an audio call at any URL. | |
1ed219c8 | 7 | |
bab26a4d RBR |
8 | ## Building |
9 | ||
10 | Running `make` or `make package` will regenerate the content script, and | |
11 | package the extension for all browsers in the `./build/` directory with | |
12 | the following outputs: | |
13 | ||
14 | - `junction.xpi`: The firefox extension | |
15 | - `junction.zip`: The chrome extension | |
16 | - `Junction.app`: The safari extension app | |
17 | ||
18 | ## Developing | |
19 | ||
20 | The project is divided into three main parts: | |
21 | ||
22 | - `server`: A server that handles message passing to establish the WebRTC | |
23 | connections. | |
24 | - `extension`: The main code of the extension itself. | |
25 | - `safari`: The safari app, it wraps the extension using symlinks. | |
26 | ||
27 | ### Dependencies | |
28 | ||
29 | - `make` to run the build commands. | |
30 | - `xcode` to build the safari extension. | |
31 | - `node` and `pnpm` to build the extension, and if you want to run the server | |
32 | directly. | |
33 | - `podman` and `podman-compose` if you want to run the server as a container. | |
34 | - `prettier` to format Javascript, JSON, Yaml, and Markdown. | |
35 | - `xcbeautify` to format swift | |
36 | ||
37 | ### Server | |
38 | ||
39 | The server is a socket.io server that relays messages between peers to help | |
40 | establish a WebRTC connection. | |
41 | ||
42 | #### Configuration | |
43 | ||
44 | You can use environment variables to control the server. | |
45 | ||
46 | - `JUNCTION_SERVER_PORT` which port to listen on. Defaults to `8000`. | |
47 | ||
48 | ### Extension | |
49 | ||
50 | The extension uses WebExtension manifest v2 and is compatible with Firefox, | |
51 | Chrome and Safari. | |
52 | ||
53 | You can build all extensions using `make` in the root of the directory. | |
54 | ||
55 | If you want to run manually then you can run `pnpm install` from the | |
56 | `extension` folder to install dependencies, and `pnpm build` to generate the | |
57 | content script. | |
e3dca99b | 58 | |
59 | ``` | |
80172072 | 60 | $ pnpm install && pnpm build |
e3dca99b | 61 | ``` |
62 | ||
bab26a4d | 63 | #### Testing on Firefox |
1ed219c8 RBR |
64 | |
65 | In order to test on firefox, first go to `about:debugging`, then click | |
66 | on the `This Firefox` option. Then click on `Load Temporary Add-On` and | |
bab26a4d RBR |
67 | point the browser to the `build/junction.xpi` file if you're using `make`, or |
68 | `extension/manifest.json` file if you're testing without packaging. | |
1ed219c8 | 69 | |
bab26a4d RBR |
70 | This will enable the extension and will allow you to use the inspector to |
71 | debug. | |
a94a5407 | 72 | |
bab26a4d | 73 | #### Testing on Chrome |
a94a5407 RBR |
74 | |
75 | In order to test on chrome, first go to `chrome://extensions/`. Make sure | |
bab26a4d RBR |
76 | `Developer mode` is enabled. You can drag the `build/junction.zip` file or |
77 | click `Load Unpacked` and point the browser to the `extension` directory. | |
78 | ||
79 | #### Testing on Safari | |
80 | ||
81 | Open `Junction.app` and then enable the extension in Safari. | |
ec4adc33 | 82 | |
bab26a4d | 83 | ### Formatting |
ec4adc33 | 84 | |
bab26a4d | 85 | Running `make format` will format the code with prettify and xcbeautify |