To send a message from one content
To send a message from one content script UI to another in a browser extension using Plasmo, you can utilize the Plasmo Messaging API. Here's a step-by-step guide on how to achieve this:
1. Import the necessary functions from the
@plasmohq/messaging
library in both content script UI files:
```typescript...Yes you can pass a variable from the
Yes, you can pass a variable from the
getInlineAnchorList
function to the CSUI component itself. In your case, if you want to grab the data-x
attribute on the results item and access it in the CSUI code, you can modify the getInlineAnchorList
function to include the desired data in the anchor
object that is passed to the CSUI component.
Here's an example of how you can achieve this:
1. Modify the getInlineAnchorList
function to include the data-x
attribute in the anchor
object:...As a browser extension developer using
As a browser extension developer using Plasmo, you can change the display page in
popup.tsx
on clicking a button by utilizing the window.open()
method. This method allows you to open a new browser window or tab with a specified URL.
In your popup.tsx
file, you can define a button element with an onClick
event handler. Inside the event handler, you can use the window.open()
method to open a new window or tab with the desired URL.
Here's an example of how you can implement this functionality:...Yes you can use the normal ` style ` tag
Yes, you can use the normal
<style>
tag in Vue with Plasmo. Plasmo offers first-class support for Vue, making it easy to build browser extensions using Vue components.
To use the <style>
tag in Vue with Plasmo, you can define your styles directly in the Vue component's style
section. Here's an example:
```vue...To mount your content page CSUI inside
To mount your content page (CSUI) inside an iframe instead of a shadow DOM using
getRootContainer
, you can follow these steps:
1. Export a getRootContainer
function in your Plasmo extension code. This function will be responsible for returning the root container element where your CSUI will be mounted. Here's an example:
```typescript...Styling Plasmo CSUI – Plasmo
Hello, I have a problem with the content script fonts when it switches between tabs. The font changes styling changes (e.g, weight, size, color, etc.) to match the current tabs/page font styling (e.g if plasmo's homepage uses a global fontsize
html * { fontSize: '0.7rem' }
the content gets affected too). I read up the https://docs.plasmo.com/framework/content-scripts-ui/styling#custom-font and at one point the font family didn't change but when I tried it again on Wikipedia and it came with t...