Alright, for anyone with a similar issue. I made it work by importing the javascript file of the chrome extension into the construct script file.
I didn't think this would be required and I am still confused why I had to do this but it works for now so it's all good!