PlasmoHQ / plasmo

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

[RFC] setPanelBehavior #819

Open tianhuil opened 1 year ago

tianhuil commented 1 year ago

How do you envision this feature/change to look/work like?

Currently, running chrome.sidePanel.setPanelBehavior({ openPanelOnActionClick: true }) in background.ts is the only way to toggle a side panel when the user clicks the browser extension in Chrome. This isn't very browser-independent. Can we create a generic option that enables/disables this behavior across all browsers (e.g. safari, firefox, chrome, etc ...)?

What is the purpose of this change/feature? Why?

See above.

(OPTIONAL) Example implementations

No response

(OPTIONAL) Contribution

Verify canary release

Code of Conduct

erensertkaya commented 7 months ago

this would be awesome

frosteryd commented 7 months ago

Yes, this would be so good!

farzadmf commented 7 months ago

Hey guys; question: when I do chrome.sidePanel.setPanelBehavior({ openPanelOnActionClick: true }), I get cannot read property ... of undefined (reading setPanelBehavior).

Is there any solution/workaround for that?

maybebansky commented 4 months ago

@tianhuil did you ever get the side panel working for a non-chrome browser?

ayeshakhawaja commented 2 weeks ago

Hey guys; question: when I do chrome.sidePanel.setPanelBehavior({ openPanelOnActionClick: true }), I get cannot read property ... of undefined (reading setPanelBehavior).

Is there any solution/workaround for that?

I'm running into the same issue right now. Looks like sidePanel doesn't exist on my chrome object for some reason, even though I've set permissions: [ "sidePanel" ] in my manifest.json. Did you ever figure this out?

farzadmf commented 2 weeks ago

Did you ever figure this out?

It's been a while, but I quickly gave up on Plasmo since, IMO, it's trying to do too much abstraction, which ... concrete example here ... doesn't seem to work!