Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Debugging and Configuring Shumway

Yury Delendik edited this page Feb 5, 2015 · 22 revisions

Using the Inspector

The inspector provided as one of the examples. The local web server shall be used to open the inspector web page -- the files/resources are loaded using XMLHttpRequest, which is not working for local file system. The local web server can be created by the python -m SimpleHTTPServer (or make server) command.

The inspector is located in the examples/inspector folder and can be opened in the browser using e.g. http://localhost:8000/examples/inspector/inspector.html url. The "Open File" button can be used to open SWF and ABC files from the local system.

The inspector has several push buttons:

  • Sys - when pushed, the Shumway tries to compile (vs only interpret) playerglobal's byte code to JavaScript;
  • App - when pushed, tries to compile SWF file byte code;
  • Verifier - when pushed, uses additional optimization for the compiled code;
  • Allocator - when pushed, reduces local variables in compiled code;
  • Trace - when pushed, the additional message about compilation, interpretation and frame execution will be logged in the console;
  • Trace Calls - when pushed, logs (non-optimized) function calls with arguments / return values;
  • Trace Runtime - when pushed, logs detailed runtime events like trampolines and memoizers;
  • Release - when pushed, does not run debug asserts during code execution;
  • Pre, Render, Mouse - when pushed, enable various stages in the execution of a frame;
  • Symbols - when pushed, displays information about symbols that are currently on stage (hover mouse to see more information).
  • Sample - when pushed, uses the browser's built-in profiler to sample 5 frames.

The inspector accepts number of arguments in the query string:

All (other) parameters will be treated as flash movie parameters (flashvars).

Using the Extension

The additional configuration parameters can be set in the about:config to change the default Shumway behavior (when a parameter is absent, create a new one):

  • shumway.ignoreCTP (boolean) - for Firefox 21 and up, the extension is shown only when the click-to-play is enabled (see the setting below). Set the value of this key to true to bypass this check and always show the Shumway extension instead of the plug-in (the browser must be restarted when this setting is modified);
  • plugins.click_to_play (boolean) - enables click-to-play (requires native Flash plug-in to be installed), also for Firefox 23, on about:addons plugins tab, set "Shockwave Flash" to "Ask to Activate";
  • shumway.simpleMode (boolean) - if true is specified, the simple HTML page with two button will be shown (Shumway and Flash);
  • shumway.turboMode (boolean) - if true is specified, overrides frame rate to 60 fps;
  • shumway.whitelist (string) - comma-separated list for the sites/domains that can be accessed using URLStream/NetStream objects, if the request originated to the different URL than movie domain;
  • shumway.appCompiler (boolean) - if true is specified, enables compiler for the flash AVM2 byte code in the SWF files (default is true);
  • shumway.sysCompiler (boolean) - if true is specified, enables compiler for the system libraries (default is false);
  • shumway.verifier (boolean) - if true is specified, enables variable type verification and execution optimization for the compiler (default is true);
  • shumway.force_hidpi (boolean) - if true is specified, always uses devicePixelRatio to scale canvas, e.g. looks sharper on retina displays (default is false);
  • shumway.hud (boolean) - if true is specified, shows frame/performance counters;
  • shumway.enableForPrivate (boolean) - if true is specified, enables Shumway in Private Browsing mode;
  • shumway.externalInterface.trace - if true is specified, traces external interface calls;
  • shumway.swf.whitelist (string) - (starting Firefox 38, see bug 870553) comma-separated list of the patterns for urls of the SWFs or/and pages. An example for SWF url pattern is http://example.org/*.swf and an example for page url pattern is @http://example.org/movies/*. The space can be use to combine these two, e.g. @http://example.org/movies/* http://example.org/*.swf. Multiple entries can be used as @http://example.com/movies/*,http://example.org/*.swf;