evazion/translate-pixiv-tags

Translated tags don't load on Pixiv sometimes

Closed this issue · 2 comments

I noticed this a while ago. Basically, sometimes the translated tags don't get loaded on Pixiv, although the artist tag does. I am able to reliably replicate this by opening a Pixiv post in a new tab (right-click, open link in new tab), but not going to the tab until the tab has finished loading.

image

It takes a page refresh to get them to load.

image

Browser is Chrome 73. I verified the problem still exists even when no other userscripts are running.

I'm not sure if this issue exists on other sites, however I did check Nicoseiga and there was no issue.

7nik commented

It happens to me too but rarely so I can't investigate it.
I'm not sure, but suppose the next: in a background loading the script sometimes finish initialization after tags added to DOM but for pixiv, the script calls asyncAddTranslation (add translation when adding tags to DOM) and do nothing with already existing tags. Why it doesn't happen with artist tag? Maybe it is moved in DOM. Because asyncAddTranslatedArtists adds translation for both cases.
Maybe later I'll try to reproduce this bug on another PC.

7nik commented

I could increase the odds of the bug - the main clue was open only one background tab while I usually open a dozen tabs at once. And I was right.