exile-center / better-trading

QoL improvements for the official PathOfExile trading site.
30 stars 5 forks source link

Chrome and PoE Trade Notifications #134

Closed TKluwe closed 8 months ago

TKluwe commented 8 months ago

I can't get the numbers to show on livesearches when I enable this extension using chrome. When multiple searches are open this is useful, because I can see which one dinged by looking for the number. This issue is recent as of today. If I remove the extension and relaunch chrome it works.

GhoulSlayer001 commented 8 months ago

Yes, the same problem appeared yesterday, I thought it was only me. Having 20+ searches it is impossible to understand where exactly the item appeared

dbjorge commented 8 months ago

Thanks for reporting the issue, I'll take a look tomorrow

dbjorge commented 8 months ago

I investigated what's going on here. For background, the trade site itself actually uses 2 different methods for adding a number to trade site tabs:

1) It updates the page's favicon image with a red number badge, like this: favicon badge example 2) It updates the page title text to add the number in parentheses at the front of the title (like (3) Trade - Path of Exile)

The Better Trading extension includes a feature that updates trade page titles based on the search you're running, so page titles look like Watcher's Eye Prismatic Jewel - Trade - Path of Exile instead of just Trade - Path of Exile. This functionality overrides method 2 above, but previously this wasn't a big deal since it was redundant with method 1 anyway.

However, recently, it looks like a new issue in the trade site itself (not this extension) has broken notification method 1 above. Technical details (which I've already reported separately to GGG): to generate the favicon-with-badge image, it needs to make a CORS-enabled request to fetch the base favicon.ico file such that it can be modified in a hidden canvas element - until very recently, poecdn.com enabled this by including an Access-Control-Allow-Origin: * header in responses for favicon.ico, but recently it's begun omitting that header.

As a workaround, I'll look into updating how the page-retitling feature works to get it to preserve the number in parentheses at the start of the title.

dbjorge commented 8 months ago

Fixed by ef3cdea481cddeb390896a33d177ba5c5762d0a5

Submitted to the Chrome Web Store as v1.7.2, will be released whenever their review process completes (usually takes a day or so)