Skip to content

Comments

docs: define practices for third-party extensible APIs#586

Merged
samuelmaddock merged 5 commits intoelectron:mainfrom
samuelmaddock:docs/extensible-apis
Oct 10, 2024
Merged

docs: define practices for third-party extensible APIs#586
samuelmaddock merged 5 commits intoelectron:mainfrom
samuelmaddock:docs/extensible-apis

Conversation

@samuelmaddock
Copy link
Member

A few of Electron's existing APIs don't do a good job of supporting extensibility for third-party libraries. Let's try to define best practices to guide future API designs with third-party extensibility in mind.

protocol.registerSchemesAsPrivileged

session.setPreloads / session.getPreloads

  • Requires replacing all preloads rather than adding a single preload
session.setPreloads([
  ...session.getPreloads(),
  path.join(__dirname, 'new-preload-script.js')
])

@samuelmaddock samuelmaddock requested a review from a team as a code owner October 3, 2024 19:19
Copy link
Member

@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@itsananderson itsananderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as well. Sorry I forgot to come back and stamp after your updates 😅

@samuelmaddock samuelmaddock merged commit a193a7d into electron:main Oct 10, 2024
@samuelmaddock samuelmaddock deleted the docs/extensible-apis branch October 10, 2024 18:27
@timfish
Copy link

timfish commented Oct 10, 2024

Thanks for your work on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants