GoatSalad / megukascript

Userscript for the meguca imageboard
5 stars 3 forks source link

Fix finding of posts corresponding to hovered image #37

Closed dasdgdafg closed 6 years ago

dasdgdafg commented 6 years ago

The img.src was something like "https://meguca.org/assets/images/src/hash.png", but the thumbnail only links to "/assets/images/src/hash.png". This was causing the call to querySelectorAll to not find anything.
Now it will construct a URL, and check for something where the end of the link matches the pathname of the URL. This "should" work even if one or the other flip between relative and absolute links.