PlasmoHQ / plasmo

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

[RFC] Add more function-based templates. #555

Open gxy5202 opened 1 year ago

gxy5202 commented 1 year ago

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

I see #452 and have some ideas.

I think we can do more. First, we do need more default templates, such as devtools pannel, only background.js, newtab, option, contextMenu, shortcut key... If we can list all optional configurations(According to browser extension standard), then user can freely choose what they want(multiple functions or single function).

About templates, I have an idea. We know browser extension is not like the website, UI may not the most important thing, but the function is, the message posting between the modules is, choosing the right API is. Which means, we should provide functions to our developers rather than UI templates, cause developer need read chrome's docs and spend a lot of time to test those APIs. So what if our templates provide those basic APIs and if these modules works great, so that a new developer dose not need to test those APIs again and again. I belive those who are new will be happy to use plasmo

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

Minimize the threshold for extension development. If i use a framework, i just want it to do more things for me. So if plasmo is a framework for extension developing, i hope it can solve my biggest problem: I don't want to read those offical APIs and test them again and again at first. When I create a template, i want the template to provide those APIs and provide the right way to use them. So i just need to understand the template and test it.

(OPTIONAL) Example implementations

No response

(OPTIONAL) Contact Details

gxy880520@gmail.com

Verify canary release

Code of Conduct

louisgv commented 1 year ago

Great idea and thanks for writing down these thoughts! @gxy5202 :D

DanielRuf commented 1 year ago

Is there already some working example with keyboard shortcut to trigger the extension popup?

Another issue (https://github.com/PlasmoHQ/plasmo/issues/708) links to https://developer.chrome.com/docs/extensions/reference/action/#method-openPopup but I'm not sure if this is supported in Chrome stable and how to implement / work with this in a plasmo project.

Saszr commented 1 year ago

Yeah, examples of plugin shortcut key communication are very much needed.