isaackd / AnnotationsRestored

Brings annotation support back to YouTube
GNU General Public License v3.0
160 stars 8 forks source link

Don't attempt to load annotations on videos that can't possibly have annotations. #39

Closed foxt closed 4 years ago

foxt commented 4 years ago

Currently, the extension will always try to load annotations, even on videos uploaded after annotations where removed.

Not sure how the extension works, however you could use something like the following (for Polymer):

if (new Date(document.querySelector("#date > yt-formatted-string.ytd-video-primary-info-renderer").innerText) > 1493852400000) {
    abortLoadingAnnotations()
}
ajayyy commented 4 years ago

This text is localized and so this might break for non-english users.

foxt commented 4 years ago

I'm not sure what some examples of localised strings are, but does JS not handle localized strings?

ajayyy commented 4 years ago

No, it does not. In SponsorBlock, I fetch the YouTube API to get the date in a more for sure readable form due to this issue. Either solution would slow the extension down a bit though as the request would have to wait until things are loaded instead of right after the tab first changes.

ajayyy commented 4 years ago

The month name and order is different in each language.

foxt commented 4 years ago

Yeah, in that case I think this is a wontfix.