Jen Kagan: day 3: draw it out |
i’m working on a patch for adding a button that lights up if there’s a playable URL in the page.
jared sent some links and explanations, but i also needed to draw it out.
logic:
“OK, so you’ve got a content script, that runs in each web page, and your addon code, which isn’t in the page and can’t see it
So you’ll want your content script to always load on every page, and do a querySelectorAll check for the youtube href*= selectors used by the context menu code
Once the content script (loaded by pageMod) finds a hit in the page, it should send a message back to the main addon script, telling it to light up the button
We’ll also need to detect when a new page loads and un-highlight the button (hopefully you can do this from the addon, without involving a content script, but I’m not sure)”
step-by-step:
links:
Комментировать | « Пред. запись — К дневнику — След. запись » | Страницы: [1] [Новые] |