How to stop apps from opening my browser
For Google Chrome:


Quit Google Chrome.
With Finder selected, hit the Shift-⌘-G and enter the folder address

~/Library/Application Support/Google/Chrome.
Select the Default folder, and open the Preferences file in a text editor like Text Editor.
Search for the phrase “excluded_schemes,” which houses your list of protocol handler preferences in the text file.
Search for the offending protocol (like “itmss” for iTunes, or “slack” for Slack) and change its state from “true” to “false,” taking care not to remove any punctuation.
Save the file, and re-open Chrome.


For Safari:


I recommend for a tool NoMoreiTunes, a free Safari extension that stops iTunes or the App Store app from launching automatically when you visit a store page online.
To use the NoMoreiTunes extension, simply head over to the extension’s website and download the latest version. 
Once downloaded, double-click on the extension file and Safari will detect and install it (you’ll need to verify the installation by telling Safari that you “trust” the extension).
With NoMoreiTunes installed, any time you navigate to an iTunes or App Store page in Safari, you’ll see a notification bar at the top of the window letting you know that the extension prevented the iTunes or App Store apps from launching. If, however, you’d actually like these apps to launch, you can click the button on the right side of the bar.