{
"name": "My Extension",
"targets": [
{
"matches": "*://*.example.com/*",
"load": ["main.css", "main.js"]
},
{
"matches": "<popup>",
"load": ["popup.css", "popup.js"]
},
{
"matches": "<background>",
"load": ["background.js"]
}
]
}// In the background script:
epos.bus.on('math:sum', (a, b) => a + b)
// On a web page:
const result = await epos.bus.send('math:sum', 1, 2)const state = await epos.state.connect()
// Modify like a regular object.
// Changes are synced in real time.
state.items = []
state.items.push('Hello world!')// Store in the background script:
await epos.storage.set('user-pic', imageFile)
// Access later in the popup:
const pic = await epos.storage.get('user-pic')// The same API for every context: // - background // - popup // - side panel // - web pages // - iframes import epos from 'epos'