Hey there. I’m a cybersecurity engineer. I’m Not loved on this forum today but I’ll share some thoughts. You can embed JavaScript into websites to do things like alert you if your website has been cloned. That is useful in cases like phishing resistance. We do this at my company. But you can’t embed code in a url expecting it will be executed. In fact that’s an attack vector some use to attempt RCE: remote code execution. Also URL parameters, like everything after the ? In
http://example.dev/whatever?param1=stuff¶m2=things are sanitized on input. At least the should be. Meaning “code like things” are scrubbed to avoid things like sql injection and cross site scripting.
One possibility is using referrer headers in a request to block certain traffic but that could be both complex and unreliable.