Manifest V3 Chrome extension scaffold for rendering rendered markdown SMILES code blocks as inline molecular structures.
The extension scans pages for rendered code blocks marked as SMILES, such as:
```smiles
C1=CC=CC=C1
```When it finds one, it preserves the original code block and appends a rendered SVG structure below it using smiles-drawer.
- Rendered markdown/code blocks only
- Selectors:
pre code.language-smilespre code[class*="language-smiles"]code.language-smilescode[class*="language-smiles"]
- Dynamic page updates via
MutationObserver - Settings stored in
chrome.storage.sync
- Parsing raw text nodes for literal triple-backtick fences
- Site-specific DOM adapters
- Background service worker features
- Popup-triggered page actions
- Chrome Web Store publishing flow
npm installnpm run devThis runs a watch build into dist/.
npm run buildnpm run typecheck
npm run test
npm run build- Run
npm run build - Open
chrome://extensions - Enable Developer mode
- Click
Load unpacked - Select the repo's
dist/directory
The options page stores these values in chrome.storage.sync:
enabledtheme:light | dark | autosize:small | medium | large
The popup shows the saved state and links to the options page.
- Pages that strip the
language-smilesclass or otherwise hide the markdown language hint will not match the default detector. - The scaffold appends rendered output below the source block instead of replacing site-specific markdown rendering.
- Invalid SMILES input is surfaced as a muted render failure note and leaves the source untouched.