How do I call functions and get the return values from a popup?
I've been trying to put together a simple proof-of-concept for an idea I had to create an extension that could call some functions and get data from a content script running on a page.
I can't seem to figure out how to get the communication between the popup and the content script.
I keep coming across information that says to either use the underlying
chrome.runtime
in the content script or use plasmo's messaging, but whenever I try to do any kind of messaging in the content script, I get an error saying that chrome.runtime
effectively doesn't exist (trying to access a property of a non-object).
Any ideas what I might be doing wrong?nerdo•15d ago
By the way, I noticed that in both the dev and prod manifest.json, there is no
content_scripts
key where the content.js is specified. I'm not sure what I did wrong. The content script is running but it seems like something is misconfiguredisibbot•10d ago
You need to use the messaging API plasmo provides. https://docs.plasmo.com/framework/messaging#message-flow
Plasmo Docs
Messaging API – Plasmo
The Plasmo messaging API is a powerful tool for sending real-time messages between different parts of your extension.
2.1KMembers
View on DiscordWant results from more Discord servers?
More PostsDo I have to publish a .zip manually to get the extension id?When constructing SUBMIT_KEYS for google chrome extension store in github, I need the extension id.How to adjust the with-firebase-auth to work with Arc (other chromium browsers)I'm encountering issues with the example for using Firebase Authentication when extending the scope How to create a new tab from a router?Given an index.tsx:
ex.
import { Route, Routes } from "react-router-dom"
import { Login } from "~Can a Browser Extension look like Apple's Dynamic Island?I've never built a browser extension, but I had an inkling of a UI idea to build something akin to hHow do you debug a problem when yarn dev just exits?I've got a bug where when I run yarn dev, it exists without printing anything useful:
(base) james@just out of curiosity, where does the storage live?why does it work? i cannot find any cookie or localstorage where the keys i setup from plasmo are, iSend data from content script or popup to main content script.I want to manipulate some dom items on the main world, how do I send a message from my popup or my oLoading a content script on a specific tabHowdy folks,
I'm wanting to explicitly load a content script on a specific tab, so it doesn't interf