4 ms·
For extension experts, when should developers use a framework like this versus these options: * Attaching to page DOM with custom HTML/CSS/JavaScript * Shadow
by hnthrowawaybed 3y ago
For extension experts, when should developers use a framework like this versus these options:
* Attaching to page DOM with custom HTML/CSS/JavaScript
* Shadow DOM
* Iframe
Shadow DOMs seem like a good hybrid between iframes and attaching to the page DOM.
- JoeyDoey 3y agoBedframe gives you that, basically. It's a project generator that uses Vite so it'll let you build in vanilla js and html/css and enables dev niceties like HMR so you have a live dev server, etc. but in the end you end up with just the html/css/js. Idea is, depending on what kind of extension you're building you can use content scripts to render you extension in shadow dom or iframe. Bedframe lets you do this. The CLI is a project generator for: - popup (default kind of extension) - side panel (relatively new in Chrome / https://developer.chrome.com/docs/extensions/reference/sidePanel/ https://developer.chrome.com/docs/extensions/reference/sideP...) - overlay (what you describe above) - devtools extensions (https://developer.chrome.com/docs/extensions/mv3/devtools/#devtools-ui https://developer.chrome.com/docs/extensions/mv3/devtools/#d...). Bedframe goes further and lets you add a mvp.yml workflow to your (Github) repo and have any versioned changes landing in 'main' branch get published to firefox, edge, chrome web stores Basically productionizes the extension dev process.