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

Flash SWF content not correctly loaded in Electron 7 #20744

Closed
3 tasks done
frankieta opened this issue Oct 25, 2019 · 33 comments · Fixed by #22072
Closed
3 tasks done

Flash SWF content not correctly loaded in Electron 7 #20744

frankieta opened this issue Oct 25, 2019 · 33 comments · Fixed by #22072

Comments

@frankieta
Copy link

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:

Annotazione 2019-10-25 170420

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

Annotazione 2019-10-25 170420

Additional Information

@GhostlyDark
Copy link
Contributor

Introduced with v7.0.0-beta.4

@georgelesica-wf
Copy link

This also seems to manifest on Mac.

@ncodeyx
Copy link

ncodeyx commented Nov 17, 2019

Confirmed on Windows and Mac.

@misbeliever
Copy link

Same in 7.1.2 :(

@eric-zhangqi
Copy link

some in 7.1.2 not in 6.0.7

@misbeliever
Copy link

Same in 8.0.0-beta.3

@lovoror
Copy link

lovoror commented Nov 28, 2019

Same in 8.0.0-beta.3 and 7.1.2

@kkannan-carecloud
Copy link

Anyone here know which version of electron supports flash in MacOS ?

@Rosslington
Copy link

This is also still broken in 7.1.3

@kkannan-carecloud
Copy link

If someone here is looking for the last version known to work with flash, it will be 6.1.2

@GhostlyDark
Copy link
Contributor

GhostlyDark commented Dec 9, 2019

Anything before v7 works. v7 and after are broken, since the bug was patched into master.

@Tackyou
Copy link

Tackyou commented Dec 12, 2019

The last version it works with is 7.0.0-beta.3, in beta.4 they updated chromium which broke it.

@GhostlyDark
Copy link
Contributor

@GhostlyDark
Copy link
Contributor

Using flash version 32.0.0.270 does not work.

@t57ser
Copy link
Contributor

t57ser commented Dec 17, 2019

Using flash version 32.0.0.270 does not work.

Can confirm, I also tried and it did not work

@Tackyou
Copy link

Tackyou commented Dec 17, 2019

Did you use 7.0.0-beta3 ?
Any higher version doesn’t work no matter which pepperflash version.

@GhostlyDark
Copy link
Contributor

7.0.0-beta.3 and earlier will work with pretty much any flash version, including 32.0.0.303.

@fp07
Copy link

fp07 commented Dec 26, 2019

Any updates? Workaround? The last working version is 6.1.2 for flash 32.0.0.238.

@Tackyou
Copy link

Tackyou commented Dec 29, 2019

7.0.0-beta.3 and earlier will work with pretty much any flash version, including 32.0.0.303.

You're right there was a mistake in my code.

@fp07
Copy link

fp07 commented Jan 6, 2020

Updates?

@lkonstantinov
Copy link

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_ARGUMENT error.

The fix is to amend SystemNetworkContextManager::CreateDefaultNetworkContextParams() in electron\shell\browser\net\system_network_context_manager.cc to reflect the chrome\browser\net version by adding (with the corresponding includes):

  content::UpdateCorsExemptHeader(network_context_params.get());
  variations::UpdateCorsExemptHeaderForVariations(network_context_params.get());

For more info - check out the relevant Chromium ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=940331

@Tinysymphony
Copy link

Same in 7.1.7

@JeimeRhee
Copy link

Same in v7.1.9

@JeimeRhee
Copy link

I edited electron "system_network_context_manager.cc" as @lkonstantinov said and electron build succeed.

I want to testing this electron module embedding on my local project, but I don't know how to change modified electron module to local npm packages...

Can anyone help me?

@lkonstantinov
Copy link

@JeimeRhee - you can repack electron (instructions are on the build page here - https://electronjs.org/docs/development/build-instructions-gn ) and then just replace it I guess.

@t57ser
Copy link
Contributor

t57ser commented Jan 20, 2020

@JeimeRhee you don't need to use it as an npm module, you can use the build version in /out and just modify the asar. Use:
npx asar extract default_app.asar some_folder_name
modify the files and pack it again via:
npx asar pack some_folder_name default_app.asar

@JeimeRhee
Copy link

@lkonstantinov Thx for reply. I'm sorry to late checked your reply.
I already read build instruction and try to packaging but when I execute
ninja -C out/Release electron:electron_dist_zip
it always print out "ninja no work to do." messages...
My build environment is Windows 10 is that command only working on linux environment?

@fp07
Copy link

fp07 commented Jan 23, 2020

Someone an tutorial how to apply the fix?

@kyle-mcknight
Copy link

kyle-mcknight commented Jan 29, 2020

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

@kyle-mcknight
Copy link

This does work in Electron 6.1.7 (32bit at least).

@andreieftimie
Copy link

andreieftimie commented Jan 31, 2020

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.

@fp07
Copy link

fp07 commented Feb 5, 2020

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.

Indeed

t57ser added a commit to t57ser/electron that referenced this issue Feb 6, 2020
@t57ser t57ser mentioned this issue Feb 6, 2020
4 tasks
@t57ser
Copy link
Contributor

t57ser commented Feb 6, 2020

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 (#22072) for the required changes.

deepak1556 pushed a commit that referenced this issue Feb 9, 2020
* fix: flash plugin

Fixes #20744

* cleanup

* fix linting issue
trop bot pushed a commit that referenced this issue Feb 9, 2020
trop bot pushed a commit that referenced this issue Feb 9, 2020
trop bot pushed a commit that referenced this issue Feb 9, 2020
zcbenz pushed a commit that referenced this issue Feb 10, 2020
* fix: flash plugin

Fixes #20744

* cleanup

* fix linting issue

Co-authored-by: t57ser <seve@live.at>
zcbenz pushed a commit that referenced this issue Feb 10, 2020
* fix: flash plugin

Fixes #20744

* cleanup

* fix linting issue

Co-authored-by: t57ser <seve@live.at>
zcbenz pushed a commit that referenced this issue Feb 10, 2020
* fix: flash plugin

Fixes #20744

* cleanup

* fix linting issue

Co-authored-by: t57ser <seve@live.at>
@sofianguy sofianguy moved this from Unsorted Issues to Fixed for Next Release in 7.2.x Feb 15, 2020
@sofianguy sofianguy added this to Fixed in 8.0.1 in 8.2.x Feb 15, 2020
@sofianguy sofianguy moved this from Fixed for Next Release to Fixed in 7.1.12 in 7.2.x Feb 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
7.2.x
Fixed in 7.1.12
8.2.x
Fixed in 8.0.1
Development

Successfully merging a pull request may close this issue.