browser extension
This is a basic example and you may need to add more functionality and security measures depending on your use case, also, you will have to create the UI for the users to interact with it.
It's important to note that you will need to have a local Ethereum node running or use a remote node such as Infura for the extension to connect to the Ethereum network. Also, this example is using web3.js version 1, if you want to use the latest version of web3.js you should check the documentation and adjust the code accordingly.