mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-05-19 18:58:03 +02:00
fix(windows): silent default dump on double-click (#591)
This commit is contained in:
@@ -49,6 +49,7 @@ GitHub: https://github.com/moonD4rk/HackBrowserData`,
|
||||
}
|
||||
|
||||
func main() {
|
||||
configureDoubleClickMode()
|
||||
if err := rootCmd().Execute(); err != nil {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
//go:build !windows
|
||||
|
||||
package main
|
||||
|
||||
func configureDoubleClickMode() {}
|
||||
@@ -0,0 +1,21 @@
|
||||
//go:build windows
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/inconshreveable/mousetrap"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/moond4rk/hackbrowserdata/utils/winapi"
|
||||
)
|
||||
|
||||
// configureDoubleClickMode hides the console and bypasses cobra's
|
||||
// double-click guard when launched from Explorer (issue #344).
|
||||
func configureDoubleClickMode() {
|
||||
if !mousetrap.StartedByExplorer() {
|
||||
return
|
||||
}
|
||||
|
||||
cobra.MousetrapHelpText = ""
|
||||
winapi.HideConsoleWindow()
|
||||
}
|
||||
Reference in New Issue
Block a user