You would also need to remove the delay before injecting and add an URL in the IF statement to see if the context that got created isn't from a local page, but from the actual modded website (eg:youtube.com). As discussed you could check if the URL is contained in an array of supported URLs.
As can see in this commit https://github.com/ThowZzy/TizenTube-Legacy/commit/79c95b0360df073516d0ed9dfc265b4bba2d969f
Note: The theme.js mod wasn't tested nor modified (needs testing a bit)
You would also need to remove the delay before injecting and add an URL in the IF statement to see if the context that got created isn't from a local page, but from the actual modded website (eg:youtube.com). As discussed you could check if the URL is contained in an array of supported URLs. As can see in this commit https://github.com/ThowZzy/TizenTube-Legacy/commit/79c95b0360df073516d0ed9dfc265b4bba2d969f
Note: The theme.js mod wasn't tested nor modified (needs testing a bit)