3 ms·
How does the extension hook into GitHub's DOM to inject the comment toolbar, and does it support dynamically loaded elements like in PR reviews with infinite sc
by badmonster 1y ago
How does the extension hook into GitHub's DOM to inject the comment toolbar, and does it support dynamically loaded elements like in PR reviews with infinite scroll?
- marco_patino 1y ago[dead]
- francesc_holly 1y agoChrome extensions let you execute JS on certain sites, so we can querySelect all target textareas and insert the toolbar anywhere. And yes! That includes dynamically loaded elements like the PR review window. We can even apply light/dark themes that match GitHub's ;) If you want specifics you can check out the open-source repo here: https://github.com/pullpo-io/conventional-comments https://github.com/pullpo-io/conventional-comments I suggest looking at `content.js`, constant `TARGET_TEXTAREA_SELECTORS` and function `initializeToolbarForTextarea`.