Injecting javascript into SharePoint online communication site

I need to inject some javascript into all sharepoint online communication site collection pages. I managed to do it in Team site by adding javascript file link in to a master page, but cannot find the way to do it in communication site. I found master page in communication site and managed to add my javascript file link to it, but it seems to only work on system pages (sharepoint site settings etc) . I did see some articles where its done by creating SPFX sharepoint app and importing it into the site, but doing all that just to add few lines of javascript (comparing to just adding a link into master page) seems crazy .