Skip to content

[benchmarking] Establish and test messaging connection #157

Open
@lynchee-owo

Description

@lynchee-owo

disclaimer: this is for benchmarking

Establish a reliable messaging channel between the Python script and the WebWand Chrome extension.

  • Implement the initial setup for the messaging system that allows the Python script to send commands to WebWand.
  • Write and test the openSidePanel function(in background/index.js) to ensure that WebWand can receive this message from the Python script, open the side panel accordingly, and confirm by sending a "panelOpened" message back to the Python script.

Once we are sure messaing connection is established, we can:

  • Identify and document where each listener should reside based on their functionality. For example, openSidePanel might be in background/index.js, but others like runTask might be in a different part of the extension.
  • For each listener identified, develop the specific functionalities they need to execute. For example, storeAPIKey should securely store the received key, runTask should handle task execution, and fetchScreenshot should capture and send back a screenshot.

Note:
think about how to deal with the state manament.

sample code:
chrome.runtime.onMessage.addListener((message) => { if (message.action === "openSidePanel"){ // code to operate and send message } }

Note:
check out the native messaging which enables an extension to exchange messages with a native application, installed on the user's computer. The native messaging serves the extensions without additional accesses over the web.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions