https://www.plasmo.com/ logo
Join Discord
Powered by
# code
  • c

    creamy-rocket-62079

    08/11/2022, 10:49 PM
    Hey, all just trying to set up jest for React. The
    with-jest
    demo is great but it doesn't show testing React components. As soon as I try to introduce JSX into the code I get this error:
    SyntaxError: Unexpected token '<'
    . Are there any examples of using jest to test React components?
    s
    l
    • 3
    • 2
  • c

    creamy-rocket-62079

    08/12/2022, 6:15 PM
    Hello again, thanks for your timely answer for the above question. We love using Plasmo by the way, it works great. We just had another problem we encountered and wanted to see if you all had an idea for fixing it. We are testing using jest and encountering this error
    Cannot find module '@plasmohq/storage' from 'path_to_test'
    . Any ideas on how to fix this?
    s
    • 2
    • 1
  • a

    ancient-pharmacist-61604

    08/13/2022, 4:50 PM
    Hi guys. I'm trying to migrate my extension using your cool solution. Particularly I want to use nextjs. The module from Nextjs doesn't work. Is there any caveat that i didn't catch?
    s
    • 2
    • 1
  • m

    many-article-40293

    08/14/2022, 2:08 AM
    Any way to change the container id
    plasmo-mount-container
    ?
    s
    • 2
    • 1
  • l

    late-truck-52272

    08/15/2022, 2:11 AM
    Is it possible to make a content script without Mount container, like this: https://github.com/PlasmoHQ/examples/blob/main/with-content-script/content.ts It seems not possible right now because the example code not working 🤔
    s
    • 2
    • 1
  • k

    kind-shoe-92660

    08/16/2022, 4:25 AM
    hi guys, is there any configuration file for parcel
    s
    • 2
    • 1
  • b

    brainy-mechanic-45774

    08/17/2022, 8:23 PM
    👋 hey folks! Been a while! I'm back to working on my Chrome Extension project after some time away, and I'm hitting an issue with the login flow I'm implementing. It seems I have no access to
    chrome.runtime
    on
    localhost
    - is this a known issue? I'm trying to set up an authentication flow where my site sends a ping to the Chrome Extension browser to log them in. Tried setting up an ngrok tunnel to see if that would change things but it also seems not
    s
    • 2
    • 1
  • b

    brainy-mechanic-45774

    08/17/2022, 9:14 PM
    One other question:
    s
    • 2
    • 1
  • s

    sticky-dress-98131

    08/17/2022, 9:14 PM
    Thread automatically created by @brainy-mechanic-45774 in #948852350766960660.
    b
    • 2
    • 2
  • c

    curved-glass-44538

    08/18/2022, 2:20 PM
    Wondering if it is possible to do a multiple mount with content-ui. Something like using
    document.querySelectorAll()
    to mount a component on multiple objects... 🤔
    s
    • 2
    • 1
  • t

    thousands-horse-90118

    08/20/2022, 12:28 AM
    Is there a verbose logging option in the dev server? I'm faced with a build error (plasmo can't find a .js file with some randomly generated name), and have run out of threads to pull on
    s
    • 2
    • 1
  • w

    wonderful-jewelry-41731

    08/21/2022, 9:17 AM
    Hello, is it possible to import css/scss directly to a react component (without using data-text: and creating a style element)
    s
    • 2
    • 1
  • g

    great-airline-40854

    08/23/2022, 7:51 AM
    hi guys, is there a way to config the build output html filename? I want to preview the options page instantly when there is a change in the code, but the output filename always changes to a new hash, and the previously opened chrome tab
    ..../options.xxxx.html
    automatically closed after the build was finished.
    s
    • 2
    • 1
  • c

    creamy-planet-69454

    08/23/2022, 11:29 AM
    Hey! Some of our users are reporting our extension isn't working. On investigation, it seems the contentScripts aren't being retroactively executed in tabs that were open prior to a user installing the extension. I added this snippet of code to our background script, but unfortunately it doesn't work as Plasmo's React render leans on the window
    "load"
    event. Any thoughts on this?
    s
    • 2
    • 1
  • p

    prehistoric-mechanic-36051

    08/24/2022, 8:18 AM
    Hey, guys, does anyone knows how to access document inside a content script UI, I want to get a DOM's keys with Object.keys(), but it only returns the basic property of this DOM, some other properties like '__reactFiber$' which is assigned by React DOM can't appear with that, it seems to a security issue from chrome extension
    s
    • 2
    • 1
  • p

    prehistoric-mechanic-36051

    08/24/2022, 10:56 AM
    I solve it by post message to the codes that I inject with
    chrome.scripting.executeScript
    , but still got problem with that the function I passed to
    chrome.scripting.executeScript
    shows undefined, the function I passed is imported with
    import { autofillTest } from "~modules/utils/react"
    , does the
    ~
    path caused the bundling problem? Does anyone meet the problem before?
    s
    • 2
    • 1
  • q

    quiet-engine-70935

    08/24/2022, 10:56 AM
    @prehistoric-mechanic-36051 has reached level 1. GG!
  • t

    thousands-horse-90118

    08/29/2022, 6:27 PM
    Hello! Is it possible to load an external page in an iFrame in the newtab page? I've been playing around with content security policies in the manifest, but am unable to get the iframed page to load. I wanted to know if what I'm trying to do is even possible, and if it is, how to make it work. *Context*: I'm looking to build a webapp, that gets enriched with functionality of my extension if its installed. One requirement from our product group is to be able to optionally display as the newtab page, which can only be done to my knowledge if the code for the page is bundled in with the extension. I was hoping to iframe my webapp in a newtab page distributed with my extension to make this work. Other Notes * I have seen the
    with-nextjs
    example that shows how to create two separate builds from the same set of components. Ideally, I would like to use Remix over NextJS for my webapp, due to some advantages that I perceive with that framework, but due to its design, component reuse won't be straightforward, is it seems like it could be with NextJS.
    s
    l
    • 3
    • 2
  • b

    big-cpu-76306

    08/30/2022, 12:45 AM
    Hi! Is it possible to dynamically alter something we override in the manifest? We have a shortcut command we declare in package.json but want to allow our users to customize this.
    s
    • 2
    • 1
  • b

    busy-greece-52941

    09/03/2022, 6:17 PM
    Hey! Is it possible to have multiple browser accessible (newtab) pages? And what is the recommended way of opening these pages from my code? It seems like Plasmo generates a random suffix for the newtab html files, which raises this question. Sorry if i'm being a noob here
    s
    • 2
    • 1
  • b

    busy-greece-52941

    09/05/2022, 4:02 PM
    Hey! Me again 😄 Is there a way to use a custom parcel config? Mainly I would like to polyfill some modules
    s
    • 2
    • 1
  • c

    curved-dusk-35548

    09/07/2022, 12:10 PM
    Hello, I have a question to ask. Does plasma have an example to demonstrate the method of invoking Chrome extension on the page window? That is, inject JS
    s
    q
    • 3
    • 4
  • b

    busy-greece-52941

    09/07/2022, 9:45 PM
    Hey, I'm using the @white-megabyte-24509hq/storage api, and it seems like having leaking into localStorage disabled on an extension page opened in the browser doesn't work
    s
    l
    • 3
    • 6
  • q

    quiet-engine-70935

    09/07/2022, 9:45 PM
    @busy-greece-52941 has reached level 3. GG!
  • a

    ambitious-kilobyte-93258

    09/08/2022, 6:25 AM
    Hello, how would i go about adding apis.google.com under content_security_policy? Im getting the error 'content_security_policy.extension_pages': Insecure CSP value "https://apis.google.com" in directive 'script-src'.
    s
    • 2
    • 1
  • b

    breezy-kite-70216

    09/10/2022, 1:48 AM
    Is there any way to inject a script into the "main world" via the
    chrome.scripting.executeScript
    api? I see that there's support for injecting functions (https://docs.plasmo.com/workflows/content-scripts#injecting-into-the-main-world), but I would love to inject a full script, similar to as described here: https://developer.chrome.com/docs/extensions/reference/scripting/#files. Any help is greatly appreciated!
    s
    • 2
    • 2
  • c

    creamy-rocket-62079

    09/12/2022, 9:35 PM
    Hello all, just trying to create a test for my content script. I keep getting this error:
    Cannot find module 'data-text:./index.css' from 'src/contents/index.tsx'
    . Any ideas why that would be happening?
    s
    • 2
    • 1
  • q

    quiet-engine-70935

    09/12/2022, 9:35 PM
    @creamy-rocket-62079 has reached level 2. GG!
  • t

    thousands-horse-90118

    09/13/2022, 3:37 PM
    Hi! I'm building a content script UI, and I'm trying override the default styling of #plasmo-mount-container. However, because the mount-container has inline styles, the styles I'm trying to setting via css selectors aren't taking effect. (I'd like to tweak the container to be
    {bottom:0px;}
    However, the inline style attributes include
    {top:0px;}
    which ends up overriding the bottom in my style. I'm writing some js to do what I need to, but was wondering how to do this "the plasmo way".
    s
    • 2
    • 1
  • t

    thousands-horse-90118

    09/13/2022, 7:54 PM
    Does anyone have any experience using Material UI components in a content script UI? The issue I'm having is that none of the css class names on the MUI components appear to be available in the shadow DOM created by the Plasmo CS UI. Is there a way to make them available inside the Shadow DOM?
    s
    l
    • 3
    • 3