HatScripts / youtube-auto-liker

A userscript that automatically likes 👍 each video you watch on YouTube ▶️
68 stars 15 forks source link

Use GM_config.get() after GM_config.init() has finished #26

Closed BleakBluets closed 1 year ago

BleakBluets commented 1 year ago

GM_config now reads and writes values asynchronously. There is a migration guide on their GitHub page. For this initial commit, I just put everything inside an initialization function that runs once all of the values from the config have been read.

This isn't intended to be a final solution, just a working one.

Fixes #24

BleakBluets commented 1 year ago

Technically GM_config.get() is not asynchronous, but the GM_config library now requires GM_config.init() to have finished before get() can be called. This can be assured by providing a callback function inside the GM_config object and making that function the 'entry point' to the main code.

My most recent commit moves the current 'entry point' call (setInterval) into this callback as well as the Debugger initialization.

Unless there is any refactoring that needs to be done, this PR is ready for merging.

HatScripts commented 1 year ago

Thanks @BleakBluets, merged! 🚀