PlasmoHQ / plasmo

🧩 The Browser Extension Framework
https://www.plasmo.com
MIT License
10.29k stars 356 forks source link

[BUG] Unable to open the sidepanel and send the corresponding url to the backend service at the same time/click #1039

Open lapse12 opened 2 months ago

lapse12 commented 2 months ago

What happened?

I want to achieve this at the same time: When the user clicks on the extension icon, open sidepanel, read the page url and send a network request with the url to the backend. But the chrome.sidepanel.setPanelBehavior({ openPanelOnActionClick: true }) will cover the chrome.action.onclick's behavior.

If you just click on the extension alone and open the sidepanel you can, but you can't make a network request; If you just want to make a network request, you can, but you don't open the sidepanel.

I just want both to happen at the same time. What should I do?Click to open panel

Version

Latest

What OS are you seeing the problem on?

MacOSX

What browsers are you seeing the problem on?

Chrome

Relevant log output

When I was able to open the sidepanel network requests would not be sent after onclick, so there was no corresponding log

(OPTIONAL) Contribution

Code of Conduct