Skip to content

Conversation

@tachibana-shin
Copy link
Contributor

image

I'm developing an OSS project, but unfortunately it doesn't have typescript. I opened the documentation and realized the example is very misleading

import { sendMessage, onMessage } from "webext-bridge/popup";
const response = await sendMessage("ACTION", {
    data: data
}, "background");

This causes the misunderstanding that we need to pass the argument as an object with data. It is a big misunderstanding that we just need to

import { sendMessage, onMessage } from "webext-bridge/popup";
const response = await sendMessage("ACTION", data, "background");

If we follow the example, background ({ data }) will be an object with a data field containing the data of sendMessage lmao

import { sendMessage, onMessage } from "webext-bridge/popup";
const response = await sendMessage("ACTION", {
    data: data
}, "background");

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant