Cobalt11 's Web cached splash screen Can't show -- The csp Refused execute inline style and script

265 views
Skip to first unread message

wei nie

unread,
Oct 16, 2017, 10:22:04 PM10/16/17
to cobalt-dev
I'm porting cobalt rc_11 (cobalt11.99532) to my STB now.

when we use the cobalt open the https://www.youtube.com/tv, I find the Cobalt 11 's Web cached splash screen (Download the splash page form the link element's `rel="splashscreen"`)  h5vcc-cache://splash_screen/aHR0cHM6Ly93d3cueW91dHViZS5jb20vdHY=/splash.html Can't show.

The page  h5vcc-cache://splash_screen/aHR0cHM6Ly93d3cueW91dHViZS5jb20vdHY=/splash.html is download success and read success, but can't show for the error:

[1017/010801:INFO:csp_violation_reporter.cc(129)] Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'sha256-QepP9zfx1KGGQqKuqhLHByC/iZaPNkqE+YeRz/cz1kg='". Either the 'unsafe-inline' keyword, a hash ('sha256-QepP9zfx1KGGQqKuqhLHByC/iZaPNkqE+YeRz/cz1kg='), or a nonce ('nonce-...') is required to enable inline execution.
 h5vcc-cache://splash_screen/aHR0cHM6Ly93d3cueW91dHViZS5jb20vdHY=/splash.html:24

[1017/010801:INFO:csp_violation_reporter.cc(129)] Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'sha256-BQov9qDusNN3hJD8IRjkES78glSvvRwS+XCWNdShx6k='". Either the 'unsafe-inline' keyword, a hash ('sha256-BQov9qDusNN3hJD8IRjkES78glSvvRwS+XCWNdShx6k='), or a nonce ('nonce-...') is required to enable inline execution.
 h5vcc-cache://splash_screen/aHR0cHM6Ly93d3cueW91dHViZS5jb20vdHY=/splash.html:199

Here are the following two questions:
1. can we turn off the web cached splash screen, using the local splash screen for all。
2. Now the logic is not the first time to start cobalt show the splash screen, but each time Navigation will trigger the splash screen, is this  a bug?



The whole log of devel type cobalt :

 ----HI_SVR_CC_SetMode, 955, enMode = 0-------
[668985967 ERROR-HI_RM]:HI_MPI_RM_UnRegisterCallback[684]:find Instance by pClient error!
----HI_SVR_CC_SetMode, 955, enMode = 0-------
[668987569 ERROR-HI_RM]:HI_MPI_RM_UnRegisterCallback[684]:find Instance by pClient error!
+++[launchApp, 465] APM service u32Pid = 1465
(*) SaWMan/Watcher: Process 1441 [8] has exited ABNORMALLY!
get policy value is 4194304 
RegisterAPM,69 Application [cobalt] is registered to APM
Enter Function: [static int hisi::HiEsAdapter::Impl::init():285]
onNotify,43 enter
onGetResource,30 enter
onGetFocus,12 enter
Exit Function: [static int hisi::HiEsAdapter::Impl::init()]
[1017/010828:INFO:main.cc(35)] Starting application.
[1017/010828:ERROR:user_log.cc(30)] Not implemented reached in static bool base::UserLog::IsRegistrationSupported()
[1017/010828:INFO:application.cc(455)] Initial URL: https://www.youtube.com/tv#/init?resume
[1017/010828:INFO:application.cc(460)] Fallback splash screen URL: h5vcc-embedded://youtube_splash_screen.html
[1017/010828:WARNING:localized_strings.cc(82)] Cannot open XLB file: /usr/local/bin/cobalt/content/data/i18n/en-US.xlb
[1017/010828:WARNING:localized_strings.cc(82)] Cannot open XLB file: /usr/local/bin/cobalt/content/data/i18n/en.xlb
[1017/010828:WARNING:localized_strings.cc(82)] Cannot open XLB file: /usr/local/bin/cobalt/content/data/i18n/en-US.xlb
[1017/010828:WARNING:localized_strings.cc(82)] Cannot open XLB file: /usr/local/bin/cobalt/content/data/i18n/en.xlb
[1017/010828:ERROR:application.cc(600)] 
  *** Disabling the default navigation whitelist! ***
  *** Do not run in this mode in production!      ***
[1474:248476601:WARNING:thread_set_name.cc(36)] Thread name "StorageManager SQL" was truncated to "StorageManager "
[1465:248477906:WARNING:system_get_property.cc(106)] SbSystemGetProperty: Unrecognized property: 10
get policy value is 4194304 
commandline read: cobalt
commandline read: --csp_mode=disable
commandline read: --disable_navigation_whitelist
commandline read: --fallback_splash_screen_url=h5vcc-embedded://youtube_splash_screen.html

   ~~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 1.6.1 |~~~~~~~~~~~~~~~~~~~~~~~~~~
        (c) 2001-2012  The world wide DirectFB Open Source Community
        (c) 2000-2004  Convergence (integrated media) GmbH
      ----------------------------------------------------------------

(*) DirectFB/Core: Multi Application Core. (2017-09-29 01:35) 
(*) Direct/Memcpy: Using libc memcpy()
(*) Fusion/SHM: Using MADV_REMOVE (3.18.16.0 >= 2.6.19.2)
(*) Direct/Thread: Started 'Fusion Dispatch' (-1) [MESSAGING OTHER/OTHER 0/0] <8388608>...
(*) Direct/Thread: Started 'Fusion Deferred' (-1) [MESSAGING OTHER/OTHER 0/0] <8388608>...
(*) Core/Resource: Adding ID 9 - '/bin/cobalt/cobalt'
(*) DirectFB/Graphics: TDE Acceleration - graphic group 0.5 (graphic group)
(*) FBDev/Mode: Setting 1920x1080 ARGB
(*) FBDev/Mode: Switched to 1920x1080 (virtual 1920x2160) at 32 bit (ARGB), pitch 7680
(!) DirectFB/FBDev: Could not set gamma ramp    --> Operation not permitted
[1017/010828:INFO:browser_module.cc(1313)] 

AutoMem:

 SETTING NAME                           VALUE                    TYPE   SOURCE    
 ________________________________________________________________________________ 
|                                      |             |          |      |         |
| [32mimage_cache_size_in_bytes [0m            |    [32m20971520 [0m |  [32m20.0 MB [0m |  [32mGPU [0m | [32mAutoSet [0m |
|______________________________________|_____________|__________|______|_________|
|                                      |             |          |      |         |
| [32mjavascript_gc_threshold_in_bytes [0m     |      [32m8388608 [0m |    [32m8.0 MB [0m |  [32mCPU [0m |    [32mBuild [0m |
|______________________________________|_____________|__________|______|_________|
|                                      |             |          |      |         |
| [32mmisc_cobalt_cpu_size_in_bytes [0m        |    [32m124780544 [0m | [32m119.0 MB [0m |  [32mCPU [0m | [32mAutoSet [0m |
|______________________________________|_____________|__________|______|_________|
|                                      |             |          |      |         |
| [32mmisc_cobalt_gpu_size_in_bytes [0m        |    [32m11184810 [0m |  [32m10.7 MB [0m |  [32mGPU [0m | [32mAutoSet [0m |
|______________________________________|_____________|__________|______|_________|
|                                      |             |          |      |         |
| [32moffscreen_target_cache_size_in_bytes [0m |          [32mN/A [0m |      [32mN/A [0m |  [32mN/A [0m |      [32mN/A [0m |
|______________________________________|_____________|__________|______|_________|
|                                      |             |          |      |         |
| [32mremote_typeface_cache_size_in_bytes [0m  |      [32m4194304 [0m |    [32m4.0 MB [0m |  [32mCPU [0m |    [32mBuild [0m |
|______________________________________|_____________|__________|______|_________|
|                                      |             |          |      |         |
| [32mskia_atlas_texture_dimensions [0m        | [32m2048x2048x2 [0m |    [32m8.0 MB [0m |  [32mGPU [0m | [32mAutoSet [0m |
|______________________________________|_____________|__________|______|_________|
|                                      |             |          |      |         |
| [32mskia_cache_size_in_bytes [0m             |      [32m4194304 [0m |    [32m4.0 MB [0m |  [32mGPU [0m |    [32mBuild [0m |
|______________________________________|_____________|__________|______|_________|
|                                      |             |          |      |         |
| [32msoftware_surface_cache_size_in_bytes [0m |          [32mN/A [0m |      [32mN/A [0m |  [32mN/A [0m |      [32mN/A [0m |
|______________________________________|_____________|__________|______|_________|

 MEMORY                 SOURCE          TOTAL       SETTINGS CONSUME   
 _____________________________________________________________________ 
|                      |               |           |                  |
| [32mmax_cobalt_cpu_usage [0m | [32mStarboard API [0m | [32m1657.8 MB [0m |          [32m131.0 MB [0m |
|______________________|_______________|___________|__________________|
|                      |               |           |                  |
| [32mmax_cobalt_gpu_usage [0m |          [32mUnset [0m | [32m<UNKNOWN> [0m |          [32m42.7 MB [0m |
|______________________|_______________|___________|__________________|



[1017/010829:INFO:graphics_system.cc(128)] display_: 0x1
DirectFB Window Double Buffer Surface, address0 = 0x4af5000, address1 = 0x5ac7000
gpu wrap dmabuf fd = 44
gpu wrap dmabuf fd = 44
[1017/010829:INFO:hardware_rasterizer.cc(548)] skia_cache_size_in_bytes: 4194304
[1017/010829:INFO:hardware_rasterizer.cc(549)] scratch_surface_cache_size_in_bytes: 0
[1017/010829:INFO:hardware_rasterizer.cc(551)] surface_cache_size_in_bytes: 0
[1483:248929822:WARNING:thread_set_name.cc(36)] Thread name "Screenshot IO thread" was truncated to "Screenshot IO t"
[1482:248943781:ERROR:system_get_path.cc(185)] Not implemented reached in bool SbSystemGetPath(SbSystemPathId, char*, int)
[1017/010829:INFO:base_paths_starboard.cc(108)] DIR_SYSTEM_FONTS_CONFIGURATION not defined.
[1017/010829:INFO:base_paths_starboard.cc(99)] DIR_SYSTEM_FONTS not defined.
[1017/010829:INFO:SkFontStyleSet_cobalt.cc(99)] Failed to find font file: /usr/local/bin/cobalt/content/data/fonts/Roboto-Regular-Subsetted.ttf
[1017/010829:INFO:SkFontStyleSet_cobalt.cc(99)] Failed to find font file: /usr/local/bin/cobalt/content/data/fonts/NotoSansJP-Regular.otf
[1017/010829:INFO:SkFontStyleSet_cobalt.cc(99)] Failed to find font file: /usr/local/bin/cobalt/content/data/fonts/DroidSansFallback.ttf
[1017/010829:INFO:SkFontStyleSet_cobalt.cc(346)] Scanned font from file: Roboto(0)
[1017/010829:INFO:SkTypeface_cobalt.cc(70)] Created SkTypeface_CobaltStreamProvider: sans-serif(0); File: "/usr/local/bin/cobalt/content/data/fonts/Roboto-Regular.ttf"
[1017/010829:INFO:hardware_rasterizer.cc(589)] Max renderer surface size: 4096
[1484:248960781:WARNING:thread_set_name.cc(36)] Thread name "Rasterizer Submission Disposal" was truncated to "Rasterizer Subm"
[1017/010829:INFO:decoder_buffer_allocator.cc(45)] Allocated media buffer pool on demand.
[1487:248961720:WARNING:thread_set_name.cc(36)] Thread name "DebugConsoleWebModule" was truncated to "DebugConsoleWeb"
[1017/010829:INFO:page_visibility_state.cc(70)] PageVisibilityState: app_state=kApplicationStateStarted (2)
[1491:249046637:WARNING:thread_set_name.cc(36)] Thread name "Synchronous Load" was truncated to "Synchronous Loa"
[1017/010829:ERROR:user_log.cc(38)] Not implemented reached in static bool base::UserLog::Register(base::UserLog::Index, const char*, const void*, size_t)
[1017/010829:INFO:fetcher_factory.cc(102)] Fetching: file:///cobalt/browser/debug_console/debug_console.html
[1017/010829:INFO:splash_screen.cc(80)] Created SplashScreen. url_to_pass before is //youtube_splash_screen.html
[1017/010829:INFO:splash_screen.cc(82)] Created SplashScreen. key is splash_screen/aHR0cHM6Ly93d3cueW91dHViZS5jb20vdHY=/splash.html
[1017/010829:INFO:splash_screen.cc(96)] the key is valid. set the url_to_pass to //splash_screen/aHR0cHM6Ly93d3cueW91dHViZS5jb20vdHY=/splash.html
[1493:249073708:WARNING:thread_set_name.cc(36)] Thread name "SplashScreenWebModule" was truncated to "SplashScreenWeb"
[1017/010829:INFO:fetcher_factory.cc(102)] Fetching: file:///cobalt/browser/debug_console/debug_console.css
[1017/010829:INFO:fetcher_factory.cc(102)] Fetching: file:///cobalt/browser/debug_console/debug_console.js
[1017/010829:INFO:fetcher_factory.cc(102)] Fetching: file:///cobalt/browser/debug_console/console_values.js
[1017/010829:INFO:page_visibility_state.cc(70)] PageVisibilityState: app_state=kApplicationStateStarted (2)
[1497:249116078:WARNING:thread_set_name.cc(36)] Thread name "Synchronous Load" was truncated to "Synchronous Loa"
[1017/010829:INFO:fetcher_factory.cc(102)] Fetching: h5vcc-cache://splash_screen/aHR0cHM6Ly93d3cueW91dHViZS5[...]
[1017/010829:INFO:splash_screen_cache.cc(107)] SplashScreenCache::ReadCachedSplashScreen full_path is //.cache/cobalt/splash_screen/aHR0cHM6Ly93d3cueW91dHViZS5jb20vdHY=/splash.html
[1017/010829:INFO:fetcher_factory.cc(102)] Fetching: file:///cobalt/browser/debug_console/message_log.js
[1017/010829:INFO:splash_screen_cache.cc(116)] SplashScreenCache::ReadCachedSplashScreen result_size is 82227
[1017/010829:INFO:fetcher_factory.cc(102)] Fetching: file:///cobalt/browser/debug_console/command_input.js
[1017/010829:INFO:csp_violation_reporter.cc(129)] Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'sha256-QepP9zfx1KGGQqKuqhLHByC/iZaPNkqE+YeRz/cz1kg='". Either the 'unsafe-inline' keyword, a hash ('sha256-QepP9zfx1KGGQqKuqhLHByC/iZaPNkqE+YeRz/cz1kg='), or a nonce ('nonce-...') is required to enable inline execution.
 h5vcc-cache://splash_screen/aHR0cHM6Ly93d3cueW91dHViZS5jb20vdHY=/splash.html:24
[1017/010829:WARNING:exception_helpers.cc(52)] Tried to get stack trace without access to compartment.
[1017/010829:INFO:csp_violation_reporter.cc(129)] Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'sha256-BQov9qDusNN3hJD8IRjkES78glSvvRwS+XCWNdShx6k='". Either the 'unsafe-inline' keyword, a hash ('sha256-BQov9qDusNN3hJD8IRjkES78glSvvRwS+XCWNdShx6k='), or a nonce ('nonce-...') is required to enable inline execution.
 h5vcc-cache://splash_screen/aHR0cHM6Ly93d3cueW91dHViZS5jb20vdHY=/splash.html:199
[1017/010829:WARNING:exception_helpers.cc(52)] Tried to get stack trace without access to compartment.
[1017/010829:INFO:fetcher_factory.cc(102)] Fetching: file:///cobalt/browser/debug_console/debug_commands.js
[1017/010829:INFO:fetcher_factory.cc(102)] Fetching: file:///cobalt/browser/debug_console/debugger_client.js
[1017/010829:INFO:page_visibility_state.cc(70)] PageVisibilityState: app_state=kApplicationStateStarted (2)
[1502:249179069:WARNING:thread_set_name.cc(36)] Thread name "Synchronous Load" was truncated to "Synchronous Loa"
[1017/010829:INFO:application.cc(918)] User Agent: Cobalt/11.99532-devel(Hisi Linux armv7l; U; en) Starboard/6-ReleaseCandidate, Hisense_TV_3751V551/1.01 (Hisense, SmartTV, Wired)
[1017/010829:INFO:fetcher_factory.cc(102)] Fetching: https://www.youtube.com/tv#/init?resume
[1503:249197871:WARNING:thread_set_name.cc(36)] Thread name "WebDriver thread" was truncated to "WebDriver threa"
[1017/010829:INFO:server.cc(191)] Starting WebDriver server on port 4444
[1017/010829:INFO:debug_web_server.cc(332)] Debug web server running at: http://10.1.1.10:9222
[1017/010830:INFO:fetcher_factory.cc(102)] Fetching: https://s.ytimg.com/yts/cobalt/youtube_splash_screen-vf[...]
[1017/010830:INFO:fetcher_factory.cc(102)] Fetching: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAmwAAAEsC[...]
[1017/010830:INFO:fetcher_factory.cc(102)] Fetching: https://www.youtube.com/s/tv/html5/loader/live.js
[1017/010831:INFO:fetcher_factory.cc(102)] Fetching: https://www.youtube.com/s/tv/html5/5a69ef30/api-compiled.js
[1017/010831:INFO:fetcher_factory.cc(102)] Fetching: https://www.youtube.com/s/tv/html5/5a69ef30/cobalt-prod.css
[1017/010831:INFO:fetcher_factory.cc(102)] Fetching: https://www.youtube.com/s/tv/html5/5a69ef30/app-prod.js
[1017/010832:WARNING:parser.cc(538)] /s/tv/html5/5a69ef30/cobalt-prod.css:1:134225: warning: unsupported value
...}.opera .focused,.opera :focus{outline:invert none medium}.chromeless #browse-se...
                                          ^
[1017/010832:INFO:splash_screen_cache.cc(73)] SplashScreenCache::CacheSplashScreen full_path is //.cache/cobalt/splash_screen/aHR0cHM6Ly93d3cueW91dHViZS5jb20vdHY=/splash.html
[1017/010832:INFO:splash_screen_cache.cc(75)] SplashScreenCache::CacheSplashScreen WriteAll called. content size = 82227
[1017/010835:INFO:browser_module.cc(512)] Loaded WebModule
[1017/010835:INFO:url_utils.cc(124)] Update URL to https://www.youtube.com/tv#/init?resume
[1506:255324937:WARNING:thread_set_name.cc(36)] Thread name "AsyncAudioDecoder" was truncated to "AsyncAudioDecod"
[1017/010835:INFO:fetcher_factory.cc(102)] Fetching: https://www.youtube.com/s/tv/html5/5a69ef30/img/default[...]
[1017/010835:INFO:url_utils.cc(124)] Update URL to https://www.youtube.com/tv#/init?resume
[1017/010835:INFO:url_utils.cc(124)] Update URL to https://www.youtube.com/tv#/browse-sets?c=default&resume
[1017/010835:INFO:fetcher_factory.cc(102)] Fetching: https://www.youtube.com/s/tv/html5/5a69ef30/img/legend-[...]
[1017/010835:INFO:fetcher_factory.cc(102)] Fetching: https://www.youtube.com/s/tv/html5/5a69ef30/img/icons.ttf
[1017/010835:INFO:font_cache.cc(321)] Requested remote font from https://www.youtube.com/s/tv/html5/5a69ef30/img/icons.ttf
[1017/010836:WARNING:savegame.cc(50)] Unable to cache last savegame, which is used to prevent duplicate saves, because it is too large: 1010731 bytes
[1017/010836:INFO:SkTypeface_cobalt.cc(38)] Created SkTypeface_CobaltStream: lr-iconfont-2017-0809(0); Size: 29304 bytes
[1017/010836:WARNING:savegame.cc(50)] Unable to cache last savegame, which is used to prevent duplicate saves, because it is too large: 1010731 bytes
[1017/010837:INFO:fetcher_factory.cc(102)] Fetching: https://i.ytimg.com/vi/8d2Xw8BaoG8/hqdefault.jpg
[1017/010837:INFO:fetcher_factory.cc(102)] Fetching: https://i.ytimg.com/vi/QtVL76gh09U/hqdefault.jpg
[1017/010837:INFO:fetcher_factory.cc(102)] Fetching: https://i.ytimg.com/vi/craAcv415FM/hqdefault.jpg
[1017/010837:INFO:fetcher_factory.cc(102)] Fetching: https://i.ytimg.com/vi/vOkzPTAZ8-E/hqdefault.jpg
[1017/010838:INFO:fetcher_factory.cc(102)] Fetching: https://i.ytimg.com/vi/VkVTWW9HoRQ/hqdefault.jpg
[1017/010838:INFO:fetcher_factory.cc(102)] Fetching: https://i.ytimg.com/vi/ym9E1YG3_QQ/hqdefault.jpg
[1017/010838:INFO:fetcher_factory.cc(102)] Fetching: https://i.ytimg.com/vi/nU4EJfX2aXE/hqdefault.jpg
[1017/010838:INFO:fetcher_factory.cc(102)] Fetching: https://i.ytimg.com/vi/bbZC1xnQvDA/hqdefault.jpg
[1017/010838:INFO:fetcher_factory.cc(102)] Fetching: https://www.youtube.com/s/tv/html5/5a69ef30/img/icon-pl[...]

Maksym Motornyy

unread,
Oct 17, 2017, 4:22:29 PM10/17/17
to cobalt-dev
Hi Wei,

Can you please rebase to release_11 branch, delete Cobalt's cache and verify if splash screen is functioning?

To your questions:
1. You can provide a local, non-YouTube branded splash screen as a fallback for a web splash screen by means of --fallback_splash_screen_url command line switch. In situations when the web splash screen is not available (for example, a cold start or a start after cache has been cleared), your fallback splash screen will be displayed. A good example of such screen would be a page that says "Loading...". Do not use any of YouTube assets (logo or even color) for the fallback splash screen.

2. It is expected that each navigation triggers the splash screen. Cobalt by design is a single-page application container and navigations should almost never happen in production.

Sincerely,
Maksym Motornyy.

wei nie

unread,
Oct 18, 2017, 8:21:42 AM10/18/17
to cobalt-dev
Good news,I update the cobalt to Release 11 (11.104700), the bug fixes.  The Web cached splash screen can use.  
the cobalt can cached and show the splash screen page from the homepage of the youtube TV. (such as  <link rel="splashscreen" href="https://s.ytimg.com/yts/cobalt/youtube_splash_screen-vflubF9np.html">).

Reply all
Reply to author
Forward
0 new messages