How to run macros automatically when a particular webpage is loaded?

Hello

How can I set a macro to run automatically whenever a particular webpage is loaded that its URL matches a specific wildcard format e.g. .site./click/* ?

Thanks

The best solution depends on what exactly the macro should do. so what would be the use case?

I need to build macros that will do the following things:

On webpages that match a wildcard expression (e.g. somesite.com/*), I want to:

  1. Whenever a particular tickbox or dropdown menu exists, select a specific value that matches a wildcard
  2. Whenever the webpage contains specific text, close the webpage