alank
alank
PD🧩 Plasmo Developers
Created by alank on 6/5/2023 in #👾extension
Which is the current preferred method to wake a BGSW? FCM or WebSocket polling?
In the case of FCM, is the popup page the supposed to send the API call to gcm as specified here? https://www.plasmo.com/blog/posts/firebase-cloud-messaging-chrome-extension
25 replies
PD🧩 Plasmo Developers
Created by alank on 5/9/2023 in #👟framework
Not seeing background hits with use of relay
Tried out several things to have the relay package hit my BGSW. Currently attempting this:
import type { PlasmoCSConfig } from "plasmo"

import { sendToBackgroundViaRelay } from "@plasmohq/messaging"

export const config: PlasmoCSConfig = {
matches: ["<all_urls>"],
run_at: "document_start",
world: "MAIN"
}

window.hello = {
"name": "hello",
"version": "0.0.0",
tryFunc: async () => {
console.log("Extension is running")
await sendToBackgroundViaRelay({
name: "request"
})
}
}
import type { PlasmoCSConfig } from "plasmo"

import { sendToBackgroundViaRelay } from "@plasmohq/messaging"

export const config: PlasmoCSConfig = {
matches: ["<all_urls>"],
run_at: "document_start",
world: "MAIN"
}

window.hello = {
"name": "hello",
"version": "0.0.0",
tryFunc: async () => {
console.log("Extension is running")
await sendToBackgroundViaRelay({
name: "request"
})
}
}
and the background/messages/request.ts looks like this:
import type { PlasmoMessaging } from "@plasmohq/messaging"

const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
console.log("request handler", req.body)
}

export default handler
import type { PlasmoMessaging } from "@plasmohq/messaging"

const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
console.log("request handler", req.body)
}

export default handler
Any ideas on what I may be messing up?
19 replies
PD🧩 Plasmo Developers
Created by alank on 4/19/2023 in #👾extension
Best way to use `useStorage` with `SecureStorage`?
Looking at setting up useStorage hooks for SecureStorage items. Are there preferred ways of handling the password setting for the new SecureStorage? Any examples?
4 replies
PD🧩 Plasmo Developers
Created by alank on 4/18/2023 in #👾extension
Seeing an error `The "path" argument must be of type string. Received an instance of Object`
Trying to run pnpm dev Full error response is:
🔴 ERROR | Build failed. To debug, run plasmo dev --verbose.
🔴 ERROR | Failed to resolve 'process' from './node\_modules/.pnpm/@plasmohq+parcel-resolver@0.12.1/node\_modules/@plasmohq/parcel-resolver/dist/polyfills/assert.js'
🔴 ERROR | The "path" argument must be of type string. Received an instance of Object
🔴 ERROR | Build failed. To debug, run plasmo dev --verbose.
🔴 ERROR | Failed to resolve 'process' from './node\_modules/.pnpm/@plasmohq+parcel-resolver@0.12.1/node\_modules/@plasmohq/parcel-resolver/dist/polyfills/assert.js'
🔴 ERROR | The "path" argument must be of type string. Received an instance of Object
8 replies