As I understand it, the moment you’re dealing with custom scripts, you’ve left the realm of a csrf attack. They’re dependent upon session tokens in cookies

Csrf is not dependent on js. It happens via normal links on external sites.

That's what I said, yes.

Sorry, I misread your comment