Open Glodenox opened 1 year ago
URLs can be parsed with the JavaScript URL object, which then allows checking the pathfile contents without the query parts.
Additionally, this is a good time to clean up that code from "yay, it works, ship it" to "I could easily support other image hosting sites here".
URLs like https://i0.wp.com/mediachomp.com/wp-content/uploads/2022/05/moose-dive-comic-03.jpg?resize=650%2C651&ssl=1 should still be detected as an image URL. Either due to the query params or the "%2C", this is not detected as an image.
Ideally, there's a way to check the presence of an image for every link that doesn't end with a slash. But I suspect that will cause quite a few unnecessary network calls.