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

feat: add support for loading webpack assets via custom protocol #3511

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MarshallOfSound
Copy link
Member

This is more secure than using file:// and aligns us with Electron on the intention to stop making the file:// protocol special and powerful.

Fixes #3508

Testing this is kinda a nightmare but I think it works, leaving as draft till I'm 100% sure tho

This is more secure than using file:// and aligns us with Electron
on the intention to stop making the file:// protocol special and powerful.

Fixes #3508
const STATUS_CODE_FORBIDDEN = 403;
const STATUS_CODE_INTERNAL_SERVER_ERROR = 500;

protocol.registerFileProtocol(config.protocolName, (request, cb) => {

Choose a reason for hiding this comment

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

Isn't this call deprecated in the recent Electron versions and instead one should use "handle"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, but it's not gonna be removed any time soon and we can migrate at some point in the future. This at the moment is more performant that handle for complicated reasons so to avoid issues around that we'll use the deprecated API for a bit

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