getstation / electron-chrome-extension

Implementation of Chrome extension APIs for Electron
139 stars 26 forks source link

[Fix] Inject CSP into Chrome Extensions requests #48

Closed Nacryn closed 5 years ago

Nacryn commented 5 years ago

What is this PR

It injects the related Content Security Policies into each Chrome Extension related requests.

How does it work

It changes the registered protocol from buffer to stream, then check when the request is related to a chrome extension, and if it's the case: inject the related CSP.

Tests

This is the shady part, as it doesn't seem to happen to everyone.