disable swipe to go back chrome

To disable swipe to go back in Chrome using Go language, you can use the robotgo package, which provides Go bindings for the cross-platform library that allows you to control the mouse and keyboard. Here are the steps to achieve that:

  1. Install the robotgo package by running the following command in your terminal:
go get github.com/go-vgo/robotgo
  1. Import the robotgo package in your Go code:
import "github.com/go-vgo/robotgo"
  1. Use the robotgo.EventHook() function to hook into the mouse events:
robotgo.EventHook(robotgo.MouseWheel, []string{})
  1. Inside the event loop, use the robotgo.EventStart() function to start capturing mouse events:
go robotgo.EventStart()
  1. In the event loop, you can check for mouse wheel events and disable the swipe to go back action:
for {
    event := <-robotgo.EventStart()
    if event.Kind == robotgo.MouseWheel {
        robotgo.EventEnd()
    }
}
  1. Run your Go program to disable the swipe to go back action in Chrome.

This code will hook into the mouse events and disable the swipe to go back action by ending the event when a mouse wheel event is detected.