FooSoft / yomichan

Japanese pop-up dictionary extension for Chrome and Firefox.
https://foosoft.net/projects/yomichan
Other
1.05k stars 203 forks source link

DocumentUtil static #2232

Closed toasted-nutbread closed 1 year ago

toasted-nutbread commented 1 year ago

This change updates DocumentUtil to be entirely a static utility class. The reason that this was originally non-static was due to the use of its _transparentColorPattern field, which was stored to cache the regex. However, this can just as easily be assigned to the class itself for the same functionality. This simplifies the class API quite a bit and will no longer require instantiating and sharing instances across various classes.