Check referrer

Hello, I want to build a widget that will be used on another website as an iframe. I want to check the referrer is yyy.com to only allow the widget to work when it's used from yyy.com

I know this is possible to do using the Firebase domain, setting a custom rule, but I am not sure how to do this using FF...

I thought by a custom action that runs on every page load and checks the referrer is yyy.com, but Copilot doesn't seem to be working as I get the error: "Too many requests. Please wait a little before trying again." I've never used it before...

Any ideas?