Comments (1)
In your content-script
import { sendMessage } from "webext-bridge/content-script";
const res = await sendMessage(
"get-data",
{},
"background"
);
console.log(res) // anything
and in your background
:
import { onMessage } from "webext-bridge/background";
onMessage("get-data", ({ data }) => {
return 'anything';
});
More usage details here:
https://github.com/zikaari/webext-bridge#example
from vite-vue3-chrome-extension-v3.
Related Issues (20)
- Question: image paths inside vue components HOT 1
- [Feature] Add on install webpage example
- [Feature] Add DaisyUI
- content-script does not use iframe, style issue HOT 2
- How do I quickly apply changes from this repository to my plugin? HOT 1
- When my plugin opens a local html page, it can't find the js file in the same directory as the page? HOT 7
- [Feature] Add offscreen document sample
- [Feature] Support live reload for Install & Update pages
- Scripts should use `module` type
- [TODO] migrate to unplugin-vue-router
- [Feature] Add tailwind prettier plugin class support
- [Feature] Add oxc plugin for vscode
- Add Prefix To Isolate Source Website And Our Plugin HOT 7
- Switch to chrome-types
- Add vue devtools vite plugin HOT 12
- Global error handling to avoid extension context issues HOT 1
- Source files (.ts) in dist folder HOT 7
- TODO Update to Vite 5 HOT 2
- Fix for the src problem HOT 6
- Migrate to Nuxt
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vite-vue3-chrome-extension-v3.