From the developer
My youtube extension thought "16h ago" was a channel
I maintain a youtube channel blocker, and one of the bugs I fixed this year was a block button beside 8 16h ago. That's eight views and an upload age, but the extension had read it as a channel name.
This was on a channel's Videos tab. channelfence already had a button in the channel header, where you'd expect it. Further down, it was also offering to block the statistics underneath a video. The extra button's accessible label was literally Block 8 16h ago.
I went back to the old version to reproduce it for this post. These are local test pages with the relevent youtube markup, so the layout is deliberately plain. The block buttons come from the actual extension.
8 16h ago is the bug. You can open either screenshot at full size.youtube doesn't give every video card the same kind of creator information. There might be a channel link, an avatar with an accessible label, or just some text. channelfence has fallbacks for those different layouts. On this card there was no avatar or channel link to read, and the text fallback picked up a row containing the view count and upload age.
There was already a check to reject timestamps. It understood things like 16 hours ago, with a space before the full word. youtube's shorter 16h ago didn't match. The row got through and became a supposed creator.
The markup even contained the longer version. The individual span had aria-label="16 hours ago", but the fallback was reading the containing row's textContent. That gave it the visible 8 16h ago text.
The fix in 0.2.6 extended the timestamp check to accept abbreviated units and allow the number to touch the unit. That covered 16h ago, 5d ago, 3mo ago and the other short forms in the regression test. It still required the trailing ago.
I didn't want the fix to reject a creator just for having numbers in their name. The test uses a made-up channel called Studio 16h for that reason. It looks close enough to catch an overbroad fix, but it's a creator name and should still get a working block button.
The regression tests check seven abbreviated ages, then check that avatar-backed and text-only creators still work. For Studio 16h, the test clicks the button, checks that its video disapears, reads the saved block list and checks that it contains exactly that one creator. A neighbouring creator's video has to stay visible too. Just checking that the bad button disappeared wouldn't tell me whether I'd broken blocking in the process.
This wasn't the last statistics-related fix either. Later, Korean metadata needed a follow-up change that recognised statistics rows from their markup, including a leading icon or a group of multiple metadata fields. The English timestamp check hadn't covered those layouts.
Both of the abbreviated-age tests are still in the suite. I reran them against the current 0.2.13 code while putting this together, and both passed in chrome.