sizonov_stas ads is an extension because it adds html to components of the javascript SPA.
Editing core files in vendor/flarum/core/js/src would require you to recompile those files so that vendor/flarum/core/js/dist files are created with your changes. Only dist files are used when combining js files for use on our flarum forum. You can also decide to try to add the modifications to the dist files, but that's much harder. In both of these scenario's you are going against the recommendation to keep vendor contents unmodified, modifications in the vendor directory are lost whenever there are updates for that package.
An alternative to using an extension is moving its logic to the local extend.php contained in your forum root, but doing that requires the same knowledge as you'd need for an extension. In addition you would move the responsibility of maintaining that code to yourself instead of leveraging the whole community for maintenance of that extension when keeping it open source.