Here are screenshots of my settings for Tampermonkey so that it only runs on certain sites:
Screenshot Microsoft Edge (Chromium)
Right click on Tampermonkey icon => “Manage Extensions” => set “Site access” to “On specific sites”
Screenshot Google Chrome
Right click on Tampermonkey icon => “Manage Extensions” => set “Site access” to “On specific sites”
Most of the permitted sites in the screenshot are for installing and updating userscripts. Sometimes Tampermonkey might ask for access to additional sites:
Permission request screenshot (in German, sorry)
In these cases, you have the choice to either allow or deny the additional access rights.
I haven’t seen similar options in Firefox yet.