webview_cef icon indicating copy to clipboard operation
webview_cef copied to clipboard

YouTube crash with OnDidFinishLoad

Open alldev opened this issue 1 year ago • 7 comments

Hi,

Recently I faced a problem with webview_cef library and YouTube platform. When loading YouTube (no matter main page, any inner page with video, or even a side server page with embedded video code), app crashes. I reproduce this problem not only in my application, but also on the included example in library package.

Here is the log:

[0124/111943.612038:INFO:CONSOLE(0)] "Error with Permissions-Policy header: Unrecognized feature: 'ch-ua-form-factor'.", source:  (0)
[0124/111946.173676:WARNING:browser_info.cc(298)] Returning a speculative frame for 12884901933 [3,45]
[0124/111951.339047:INFO:CONSOLE(5102)] "LegacyDataMixin will be applied to all legacy elements.
Set `_legacyUndefinedCheck: true` on element class to enable.", source: https://www.youtube.com/s/desktop/c21d783a/jsbin/desktop_polymer.vflset/desktop_polymer.js (5102)
[0124/111951.660313:WARNING:browser_info.cc(298)] Returning a speculative frame for 12884901933 [3,45]
[0124/111951.660456:WARNING:browser_info.cc(298)] Returning a speculative frame for 12884901933 [3,45]
[0124/111951.660498:WARNING:browser_info.cc(298)] Returning a speculative frame for 12884901933 [3,45]
[0124/111951.660532:WARNING:browser_info.cc(298)] Returning a speculative frame for 12884901933 [3,45]
[0124/111951.675898:INFO:CONSOLE(0)] "Error with Permissions-Policy header: Unrecognized feature: 'ch-ua-form-factor'.", source:  (0)
[0124/111951.775891:INFO:CONSOLE(0)] "Error with Permissions-Policy header: Unrecognized feature: 'ch-ua-form-factor'.", source:  (0)
[0124/111953.067548:INFO:CONSOLE(5102)] "LegacyDataMixin will be applied to all legacy elements.
Set `_legacyUndefinedCheck: true` on element class to enable.", source: https://www.youtube.com/s/desktop/c21d783a/jsbin/desktop_polymer.vflset/desktop_polymer.js (5102)
[0124/111953.277697:WARNING:browser_info.cc(298)] Returning a speculative frame for 12884901944 [3,56]
[0124/111958.460758:WARNING:browser_info.cc(298)] Returning a speculative frame for 12884901944 [3,56]
[0124/111958.460962:WARNING:browser_info.cc(298)] Returning a speculative frame for 12884901944 [3,56]
[0124/111958.461036:WARNING:browser_info.cc(298)] Returning a speculative frame for 12884901944 [3,56]
[0124/111958.461100:WARNING:browser_info.cc(298)] Returning a speculative frame for 12884901944 [3,56]
[0124/111958.476178:INFO:CONSOLE(0)] "Error with Permissions-Policy header: Unrecognized feature: 'ch-ua-form-factor'.", source:  (0)
[0124/112004.645292:WARNING:frame_impl.cc(432)] OnDidFinishLoad sent to detached frame 12884901949 [3,61] will be ignored
[0124/112005.141618:WARNING:frame_impl.cc(432)] OnDidFinishLoad sent to detached frame 12884901951 [3,63] will be ignored
Lost connection to device.
Exited

As far as I unerstand there is something on the CEF side what cause unexpected OnDidFinishLoad. Maybe something is missing in compiled CEF itself or library wrapper around it. This problem can refer not only the YouTube platform, but other unexpected (HTML5 video?) cases.

I am on macOS and Jan 15 2024 revision of the library.

Many thanks for your analysis of this case.

alldev avatar Jan 24 '24 07:01 alldev

Can reproduce, the repair of Mac issues will be slightly slower。 @alldev

SinyimZhi avatar Jan 25 '24 07:01 SinyimZhi

Hey, sorry to bother but are there any updates to this issue.

joshiGaming avatar Mar 09 '24 09:03 joshiGaming

@SinyimZhi any update?

@joshiGaming were you able to find a solution for this?

alterhuman avatar Apr 02 '24 17:04 alterhuman

@alterhuman yeah i did, you need to remove command_line->AppendSwitch("single-process"); in webview_app.h:32 and than add the helpers to your build through xcode so they appear in the app bundle under frameworks.

joshiGaming avatar Apr 05 '24 01:04 joshiGaming

@joshiGaming I don't understand this "add the helpers to your build through xcode so they appear in the app bundle under frameworks." Could you show a relevant example with pictures or files?

taenyeon avatar Apr 08 '24 06:04 taenyeon

Removing the single-process set causes crashes the app immediately for me, not sure what needs to be updated in the build process. Any help would be appreciated :)

chenasraf avatar Apr 09 '24 07:04 chenasraf

@taenyeon, of course. You can do it over cmake or directly through Xcode. Navigate to Xcode, select your project's runner, and then proceed to the 'Build Phases' section. Then you add a new phase called "Copy Files Phase".

1

Select under Destination, "Frameworks". Once there, you can easily click on the plus to add new items.

2

Click on "add others" and select all your helper app bundels that were included in the prebuilds.

3

After selecting them, simply click 'Open' followed by 'Finish'. After saving and compiling everything your build should look something like this:

5

Hope that helps :)

joshiGaming avatar Apr 09 '24 21:04 joshiGaming