From c32aea01523d14bc449d39aa727bd6c993a062d5 Mon Sep 17 00:00:00 2001 From: Farhad Makiabady Date: Fri, 5 Oct 2018 14:53:22 -0600 Subject: [PATCH] open new tabs with each validURL --- interfacer/src/browsh/comms.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/interfacer/src/browsh/comms.go b/interfacer/src/browsh/comms.go index 494af081..9c9fd792 100644 --- a/interfacer/src/browsh/comms.go +++ b/interfacer/src/browsh/comms.go @@ -147,7 +147,15 @@ func webSocketServer(w http.ResponseWriter, r *http.Request) { } // For some reason, using Firefox's CLI arg `--url https://google.com` doesn't consistently // work. So we do it here instead. - sendMessageToWebExtension("/new_tab," + viper.GetString("startup-url")) + validURL := viper.GetStringSlice("validURL") + if len(validURL) == 0 { + sendMessageToWebExtension("/new_tab," + viper.GetString("startup-url")) + } else { + for i := 0; i < len(validURL); i++ { + sendMessageToWebExtension("/new_tab," + validURL[i]) + } + } + } func sendConfigToWebExtension() {