electron: Flash SWF content not correctly loaded in Electron 7
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for an issue that matches the one I want to file, without success.
Issue Details
- Electron Version:
- 7.0.0
- Operating System:
- Windows 10 (1803)
- Last Known Working Electron version:
- 6.1.2
Expected Behavior
Loading flash content through an swf file results in the correct visualization of said content
Actual Behavior
An error “GET http://interactive-mirror3.nfb.ca/FrameLoader.swf net::ERR_INVALID_ARGUMENT” appears:

To Reproduce
Try embedding this flash website in an electron project (http://bear71.nfb.ca/#/bear71) following this tutorial: https://electronjs.org/docs/tutorial/using-pepper-flash-plugin
Screenshots

Additional Information
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 14
- Comments: 33 (8 by maintainers)
Commits related to this issue
- fix: flash plugin Fixes https://github.com/electron/electron/issues/20744 — committed to t57ser/electron by t57ser 4 years ago
- fix: flash plugin (#22072) * fix: flash plugin Fixes https://github.com/electron/electron/issues/20744 * cleanup * fix linting issue — committed to electron/electron by t57ser 4 years ago
- fix: flash plugin Fixes https://github.com/electron/electron/issues/20744 — committed to electron/electron by t57ser 4 years ago
- fix: flash plugin Fixes https://github.com/electron/electron/issues/20744 — committed to electron/electron by t57ser 4 years ago
- fix: flash plugin Fixes https://github.com/electron/electron/issues/20744 — committed to electron/electron by t57ser 4 years ago
- fix: flash plugin (#22109) * fix: flash plugin Fixes https://github.com/electron/electron/issues/20744 * cleanup * fix linting issue Co-authored-by: t57ser <seve@live.at> — committed to electron/electron by trop[bot] 4 years ago
- fix: flash plugin (#22110) * fix: flash plugin Fixes https://github.com/electron/electron/issues/20744 * cleanup * fix linting issue Co-authored-by: t57ser <seve@live.at> — committed to electron/electron by trop[bot] 4 years ago
- fix: flash plugin (#22111) * fix: flash plugin Fixes https://github.com/electron/electron/issues/20744 * cleanup * fix linting issue Co-authored-by: t57ser <seve@live.at> — committed to electron/electron by trop[bot] 4 years ago
The problem has nothing to do with the sandboxing problem suggested in #20309. It is actually caused by a bad header 😃
Chromium added more complex CORS handling that required consumers (like Electron) to register list of ‘safe’ headers that are exempt from the CORS process. One such header is X-Requested-With which is injected by the Flash plugin.
Since that change is missing in Electron, the CORS handler is rejecting the request (because it has an unrecognized header) and you get the
net::ERR_INVALID_ARGUMENTerror.The fix is to amend
SystemNetworkContextManager::CreateDefaultNetworkContextParams()inelectron\shell\browser\net\system_network_context_manager.ccto reflect thechrome\browser\netversion by adding (with the corresponding includes):For more info - check out the relevant Chromium ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=940331
Can this be prioritized for a fix?
We’re reverting to Electron 6 as our app still requires flash for some (old) functionality which we can’t yet deprecate.
I’ve managed to build this locally and can confirm the fix is working. If anyone needs to fix this manually before it gets released you can check out the pull request (https://github.com/electron/electron/pull/22072) for the required changes.
You’re right there was a mistake in my code.
If someone here is looking for the last version known to work with flash, it will be 6.1.2
Indeed
This does work in Electron 6.1.7 (32bit at least).
Why a tutorial on how to apply a fix rather than a fix being committed? I’d really rather not build a custom version of Electron to use in production code where we are dealing with taking people’s money
Updates?
Anyone here know which version of electron supports flash in MacOS ?