From d24b31f6bd6258c73414d492edb5b32f233ff32b Mon Sep 17 00:00:00 2001 From: marvzhang Date: Thu, 30 Jul 2020 14:15:15 +0800 Subject: [PATCH] added firefox --- backend/scripts/install-firefox.sh | 15 +++++++++++++++ backend/utils/system.go | 8 ++++++++ 2 files changed, 23 insertions(+) create mode 100644 backend/scripts/install-firefox.sh diff --git a/backend/scripts/install-firefox.sh b/backend/scripts/install-firefox.sh new file mode 100644 index 00000000..3343247d --- /dev/null +++ b/backend/scripts/install-firefox.sh @@ -0,0 +1,15 @@ +# lock global +touch /tmp/install.lock + +# lock +touch /tmp/install-firefox.lock + +apt-get update +apt-get -y install firefox ttf-wqy-microhei ttf-wqy-zenhei xfonts-wqy +apt-get -y install libcanberra-gtk3-module + +# unlock global +rm /tmp/install.lock + +# unlock +rm /tmp/install-firefox.lock \ No newline at end of file diff --git a/backend/utils/system.go b/backend/utils/system.go index dd41d195..3732e89f 100644 --- a/backend/utils/system.go +++ b/backend/utils/system.go @@ -74,6 +74,14 @@ func GetLangList() []entity.Lang { InstallScript: "install-chromedriver.sh", Type: constants.LangTypeWebDriver, }, + { + Name: "Firefox", + ExecutableName: "firefox", + ExecutablePaths: []string{"/usr/bin/firefox", "/usr/local/bin/firefox"}, + LockPath: "/tmp/install-firefox.lock", + InstallScript: "install-firefox.sh", + Type: constants.LangTypeWebDriver, + }, } return list }