... what do you mean by "more advanced"? The default/efficient approach with Safari is content blockers (i.e. a precompiled list of url patterns to block in the engine itself), but extensions can also include javascript too.
1Blocker - a well known 'traditional' safari content-blocker - does this for example, to provide ad blocking on sites like YouTube.