And for anyone who wish to have an out-of-the-box module, I've just made and shared it here.
Several things were fixed in it and there's no need for global variables anymore. Just download, import and use.
Several things were fixed in it and there's no need for global variables anymore. Just download, import and use.