aklinker1 / vite-plugin-web-extension

Vite plugin for developing Chrome/Web Extensions
https://vite-plugin-web-extension.aklinker1.io/
MIT License
654 stars 57 forks source link

browser.action.onClicked bug #135

Closed in-chong closed 1 year ago

in-chong commented 1 year ago

Firstly, thank you for providing such an excellent code repository

I wanted to listen to users clicking on the plugin icon, so I used browser. action. onClicked, but it didn't actually take effect. I'm not sure what the reason is Here is my code snippet

//background.js browser.action.onClicked.addListener((tab) => { // 用户点击插件图标时执行的操作 console.log("Extension icon clicked!"); // 这里可以添加更多处理逻辑 });

But no matter what, we can't listen to the data

aklinker1 commented 1 year ago

This is an issue with webextension-polyfill, not the plugin, so I'm going to close the issue.

I can still help you out though, could you share a minimal reproduction? I need to see the whole project, not just where you add the listener, to understand what is happening.