solid-devtools icon indicating copy to clipboard operation
solid-devtools copied to clipboard

Abstract extension messaging

Open thetarnav opened this issue 1 year ago • 0 comments

The messaegs sent between the adapter and the extension have to cross this road: adapter -> content -> background -> devtools (and back, maybe)

  1. In most cases the content and background scripts are just passing messages through without doing anything more. This is an opportunity to abstract this messaging system to avoid wiring every message individually. (Something in shape of webext-bridge)
// send message from adapter to devtools directly
sendMessage("MessageName", payload, "devtools")
  1. Sharing state could use the same API as solid signals, just synced between the extension and the adapter.
const [state, setState] = createBridgeSignal("NameOfTheSignal", initialValue)

thetarnav avatar Aug 28 '22 17:08 thetarnav