add hardened firefox, offline mode to menu
This commit is contained in:
@ -175,6 +175,8 @@ most of the improvements on Tor Browser Launcher also apply to TB-Updater, the
|
||||
|
||||
<a href="https://www.flaticon.com/free-icons/garlic" title="garlic icons">Garlic icons created by Icongeek26 - Flaticon</a>
|
||||
<a href="https://www.flaticon.com/free-icons/onion" title="onion icons">Onion icons created by Freepik - Flaticon</a>
|
||||
<a href="https://www.flaticon.com/free-icons/search" title="search icons">Search icons created by Freepik - Flaticon</a>
|
||||
<a href="https://www.flaticon.com/free-icons/offline" title="offline icons">Offline icons created by Flat Icons - Flaticon</a>
|
||||
|
||||
### More Screenshots:
|
||||
|
||||
|
2
main.go
2
main.go
@ -35,6 +35,8 @@ TODO: A "Default" config file which uses hardened Tor Browser for clearnet
|
||||
//go:embed tor-browser/NOT-TPO-signing-key.pub
|
||||
//go:embed garliconion.png
|
||||
//go:embed onion.png
|
||||
//go:embed www.png
|
||||
//go:embed offline.png
|
||||
//go:embed torbrowser.desktop
|
||||
//go:embed i2ptorbrowser.desktop
|
||||
var content embed.FS
|
||||
|
BIN
offline.png
Normal file
BIN
offline.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
@ -106,6 +106,18 @@ func (m *Client) servePNG(rw http.ResponseWriter, rq *http.Request) {
|
||||
return
|
||||
}
|
||||
}
|
||||
if strings.HasSuffix(rq.URL.Path, "www.png") {
|
||||
if bytes, err := m.TBD.Profile.ReadFile("www.png"); err == nil {
|
||||
rw.Write(bytes)
|
||||
return
|
||||
}
|
||||
}
|
||||
if strings.HasSuffix(rq.URL.Path, "offline.png") {
|
||||
if bytes, err := m.TBD.Profile.ReadFile("offline.png"); err == nil {
|
||||
rw.Write(bytes)
|
||||
return
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
rw.Header().Set("Content-Type", "image/png")
|
||||
|
@ -188,6 +188,14 @@ func (m *Client) ServeHTTP(rw http.ResponseWriter, rq *http.Request) {
|
||||
log.Println("Starting I2P Browser")
|
||||
go m.TBS.RunI2PBWithLang()
|
||||
http.Redirect(rw, rq, "/", http.StatusFound)
|
||||
case "/launch-firefox-browser":
|
||||
log.Println("Starting Hardened Firefox Browser")
|
||||
go m.TBS.RunTBBWithOfflineClearnetProfile("i2p.firefox", false, true)
|
||||
http.Redirect(rw, rq, "/", http.StatusFound)
|
||||
case "/launch-offline-browser":
|
||||
log.Println("Starting Hardened Firefox Browser in offline mode")
|
||||
go m.TBS.RunTBBWithOfflineClearnetProfile("i2p.firefox.offline", true, true)
|
||||
http.Redirect(rw, rq, "/", http.StatusFound)
|
||||
case "/start-tor":
|
||||
log.Println("Starting Tor")
|
||||
go m.TBS.RunTorWithLang()
|
||||
|
@ -18,6 +18,8 @@ configuration.
|
||||
|
||||
- [ - Launch I2P in Tor Browser](/launch-i2p-browser)
|
||||
- [ - Launch Tor Browser](/launch-tor-browser)
|
||||
- [ - Launch Hardened Clearnet Browser](/launch-firefox-browser)
|
||||
- [ - Launch Offline Browser](/launch-offline-browser)
|
||||
|
||||
## Tor Controls
|
||||
|
||||
|
@ -65,6 +65,20 @@ user_pref("network.IDN_show_punycode", true);
|
||||
user_pref("privacy.prioritizeonions.showNotification", false);
|
||||
`)
|
||||
|
||||
var offlinebrowserjs = append(secbrowserjs, []byte(`
|
||||
//set the proxy to 127.0.0.1:1, which will fail all requests
|
||||
user_pref("network.proxy.type", 1);
|
||||
user_pref("network.proxy.http", "127.0.0.1");
|
||||
user_pref("network.proxy.http_port", 1);
|
||||
user_pref("network.proxy.ssl", "127.0.0.1");
|
||||
user_pref("network.proxy.ssl_port", 1);
|
||||
user_pref("network.proxy.ftp", "127.0.0.1");
|
||||
user_pref("network.proxy.ftp_port", 1);
|
||||
user_pref("network.proxy.socks", "127.0.0.1");
|
||||
user_pref("network.proxy.socks_port", 1);
|
||||
user_pref("network.proxy.share_proxy_settings", true);
|
||||
`)...)
|
||||
|
||||
var secbrowserhtml = []byte(`
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
@ -355,6 +355,26 @@ func (s *Supervisor) RunI2PBAppWithLang() error {
|
||||
return s.RunTBBWithOfflineClearnetProfile(s.I2PAppDataPath(), true, false)
|
||||
}
|
||||
|
||||
func (s *Supervisor) generateOfflineProfile(profiledata string) error {
|
||||
apath, err := filepath.Abs(profiledata)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !tbget.FileExists(filepath.Join(apath, "user.js")) {
|
||||
err := ioutil.WriteFile(filepath.Join(apath, "user.js"), offlinebrowserjs, 0644)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if !tbget.FileExists(filepath.Join(apath, "pref.js")) {
|
||||
err := ioutil.WriteFile(filepath.Join(apath, "pref.js"), offlinebrowserjs, 0644)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Supervisor) GenerateClearnetProfile(profiledata string) error {
|
||||
apath, err := filepath.Abs(profiledata)
|
||||
if err != nil {
|
||||
@ -462,10 +482,12 @@ func (s *Supervisor) RunTBBWithOfflineClearnetProfile(profiledata string, offlin
|
||||
log.Println("Error copying AWO XPI", err)
|
||||
return err
|
||||
}
|
||||
if err := s.generateOfflineProfile(profiledata); err != nil {
|
||||
log.Println("Error generating Offline Profile", err)
|
||||
return err
|
||||
}
|
||||
if !strings.Contains(filepath.Base(profiledata), "i2p") {
|
||||
defaultpage = profiledata + "/index.html"
|
||||
} else {
|
||||
defaultpage = "http://127.0.0.1:7657/home"
|
||||
}
|
||||
}
|
||||
if len(s.PTAS()) > 0 {
|
||||
|
Reference in New Issue
Block a user