Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wip] feat(extensions): add enable/disable extension methods to Session #25386

Closed

Conversation

samuelmaddock
Copy link
Member

@samuelmaddock samuelmaddock commented Sep 9, 2020

Description of Change

Allows the user to toggle an extension at runtime.

This is useful in cases where an extension should be loaded, but the user can decide whether or not it should run (ie. Chrome's extension toggle preferences).

TODO:

Ref #19447

cc @sentialx - Let me know if you have any input on the direction here for these APIs.

Checklist

Release Notes

Notes: Added Session.enableExtension(extensionId) and Session.disableExtension(extensionId).

Allows the user to toggle an extension at runtime.
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Sep 9, 2020
@sentialx
Copy link
Contributor

sentialx commented Sep 9, 2020

@samuelmaddock I think it would be convenient to include enabled property into the Extension object instead of making a separate method for that. Also, would be nice to have extension-enabled and extension-disabled events, unless extension-loaded and extension-unloaded do the same thing.

Other than that, I think we should consider making an extensions namespace to avoid extension word in every event and method.
i.e. session.extensions.load(path)
What are your thoughts on this?

@samuelmaddock
Copy link
Member Author

@samuelmaddock I think it would be convenient to include enabled property into the Extension object instead of making a separate method for that. Also, would be nice to have extension-enabled and extension-disabled events, unless extension-loaded and extension-unloaded do the same thing.

I thought about adding Extension.enabled initially, but it would make directly converting from an extensions::Extension more complex. Additionally, it would need to be a fixed value which is set when serialized. That could cause confusion for folks thinking it would reflect its real-time value.

I'm not totally against the idea, I'm just not sure how best to implement it.

Other than that, I think we should consider making an extensions namespace to avoid extension word in every event and method.
i.e. session.extensions.load(path)
What are your thoughts on this?

I think that would be a clean approach. I created an issue to track this idea: #25418

@zcbenz zcbenz added the wip ⚒ label Oct 26, 2020
@samuelmaddock
Copy link
Member Author

Closing this for now. I'll re-open in the future if this becomes relevant again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants