2018-09-17 22:20:43 +00:00
|
|
|
# How to set up the build environment for Browsh on Windows
|
|
|
|
|
2023-12-09 21:15:51 +00:00
|
|
|
This guide is for those who want to set up the build environment on Windows
|
|
|
|
Command Prompt or Powershell.
|
|
|
|
Setup depends on running shell scripts. You can use **Git Bash** to run those scripts.
|
2018-09-17 22:20:43 +00:00
|
|
|
|
2018-09-21 14:05:30 +00:00
|
|
|
## Setting up Go, NodeJs, and GOPATH
|
2023-12-09 21:15:51 +00:00
|
|
|
|
2018-09-21 16:40:52 +00:00
|
|
|
Download and install Go for Windows at [Go download page](https://golang.org/dl/).
|
2018-09-17 22:20:43 +00:00
|
|
|
|
2018-09-21 16:40:52 +00:00
|
|
|
Download and install NodeJs for Windows at [NodeJs download page](https://nodejs.org/en/download/)
|
2018-09-17 22:20:43 +00:00
|
|
|
|
2018-09-21 14:05:30 +00:00
|
|
|
Using Command Prompt or Powershell:
|
2018-09-17 22:20:43 +00:00
|
|
|
|
2018-09-21 16:40:52 +00:00
|
|
|
Create a go workspace:
|
2018-09-17 23:42:53 +00:00
|
|
|
|
2023-12-09 21:15:51 +00:00
|
|
|
```shell
|
|
|
|
mkdir go
|
|
|
|
cd go
|
|
|
|
```
|
2018-09-17 23:42:53 +00:00
|
|
|
|
|
|
|
Set GOPATH to current directory.
|
2023-12-09 21:15:51 +00:00
|
|
|
|
|
|
|
```shell
|
|
|
|
set GOPATH=%cd%
|
|
|
|
```
|
2018-09-17 23:42:53 +00:00
|
|
|
|
|
|
|
Create subdirectories bin and src within your go directory:
|
2018-09-21 14:05:30 +00:00
|
|
|
|
2023-12-09 21:15:51 +00:00
|
|
|
```shell
|
|
|
|
mkdir bin
|
|
|
|
mkdir src
|
|
|
|
```
|
2018-09-17 23:42:53 +00:00
|
|
|
|
2018-09-21 16:40:52 +00:00
|
|
|
Add %GOPATH%/bin to your PATH.
|
|
|
|
|
2018-09-21 14:05:30 +00:00
|
|
|
## Installing chocolatey and dep
|
2018-09-17 23:42:53 +00:00
|
|
|
|
2018-09-21 14:05:30 +00:00
|
|
|
Download and install Chocolatey package manager at [Chocolatey download page](https://chocolatey.org/install).
|
2018-09-17 23:42:53 +00:00
|
|
|
|
|
|
|
Using chocolatey package manager run:
|
|
|
|
|
2023-12-09 21:15:51 +00:00
|
|
|
```shell
|
|
|
|
choco install dep
|
|
|
|
```
|
2018-09-17 23:42:53 +00:00
|
|
|
|
2018-09-21 14:05:30 +00:00
|
|
|
## Installing webpack, web-ext, and Firefox
|
2018-09-17 23:42:53 +00:00
|
|
|
|
2023-12-09 21:15:51 +00:00
|
|
|
```shell
|
|
|
|
npm install -g --no-audit webpack
|
|
|
|
npm install -g --ignore-scripts web-ext
|
|
|
|
```
|
2018-09-17 23:42:53 +00:00
|
|
|
|
2018-09-21 14:05:30 +00:00
|
|
|
Download and install Firefox for Windows at [Firefox download page](https://www.mozilla.org/en-US/firefox/new/).
|
2023-12-09 21:15:51 +00:00
|
|
|
Note: **Browsh requires Firefox versions 57 or higher.**
|
2018-09-17 23:42:53 +00:00
|
|
|
|
|
|
|
## Cloning the browsh repository
|
2023-12-09 21:15:51 +00:00
|
|
|
|
2018-09-17 23:42:53 +00:00
|
|
|
Navigate to GOPATH/src and run:
|
|
|
|
|
2023-12-09 21:15:51 +00:00
|
|
|
```shell
|
|
|
|
git clone https://github.com/browsh-org/browsh.git
|
|
|
|
```
|
2018-09-17 23:42:53 +00:00
|
|
|
|
2018-09-21 14:05:30 +00:00
|
|
|
## Setting up dependencies
|
2023-12-09 21:15:51 +00:00
|
|
|
|
2018-09-21 14:05:30 +00:00
|
|
|
Navigate to browsh/webext and run:
|
2023-12-09 21:15:51 +00:00
|
|
|
|
|
|
|
```shell
|
|
|
|
npm install
|
|
|
|
```
|
2018-09-21 14:05:30 +00:00
|
|
|
|
2018-09-21 16:40:52 +00:00
|
|
|
## Building browsh with Git Bash
|
2023-12-09 21:15:51 +00:00
|
|
|
|
2018-09-21 14:05:30 +00:00
|
|
|
Using Git Bash, navigate to browsh/interfacer/contrib and run:
|
2023-12-09 21:15:51 +00:00
|
|
|
|
|
|
|
```shell
|
|
|
|
./build_browsh.sh
|
|
|
|
```
|
2018-09-21 14:05:30 +00:00
|
|
|
|
2018-09-21 16:40:52 +00:00
|
|
|
## Running browsh
|
2023-12-09 21:15:51 +00:00
|
|
|
|
2018-09-21 14:13:46 +00:00
|
|
|
Using three Command Prompts or Powershells:
|
2018-09-21 14:05:30 +00:00
|
|
|
|
|
|
|
Navigate to GOPATH/browsh and run:
|
|
|
|
|
2023-12-09 21:15:51 +00:00
|
|
|
```shell
|
|
|
|
go run ./interfacer/src/main.go --firefox.use-existing --debug
|
|
|
|
```
|
2018-09-21 14:05:30 +00:00
|
|
|
|
2023-12-09 21:15:51 +00:00
|
|
|
Navigate to browsh/webext and run:
|
2018-09-21 14:05:30 +00:00
|
|
|
|
2023-12-09 21:15:51 +00:00
|
|
|
```shell
|
|
|
|
webpack --watch
|
|
|
|
```
|
2018-09-21 14:05:30 +00:00
|
|
|
|
2023-12-09 21:15:51 +00:00
|
|
|
Navigate to browsh/webext/dist and run:
|
2018-09-17 23:42:53 +00:00
|
|
|
|
2023-12-09 21:15:51 +00:00
|
|
|
```shell
|
|
|
|
web-ext run --verbose
|
|
|
|
```
|