Search code examples
xcodesafariwebkithtml5-audioweb-audio-api

bash cannot find the command `debug-safari` on macOS Catalina


I'm trying to debug an issue with HTML5 WebAudio API, provided in Safari via WebKit. I came across this debug-safari command and tried to run it but bash can't find it.

The issue is related to the creation of AudioNode/ScriptProcessorNode via createScriptProcessor(). When I try to log the properties of the object returned by createScriptProcessor(), I see [Native Code] written in console.


Solution

  • The debug-safari command is provided by WebKit.

    Do this:

    1. Get the WebKit repo: svn checkout https://svn.webkit.org/repository/webkit/trunk WebKit
    2. Go to the Scripts folder: cd Webkit/Tools/Scripts (Alternatively, add the Scripts folder to your Path: [Path-To-Downloaded-WebKit-Repo]/Tools/Scripts and run without the ./ prefix)
    3. Run the update script: ./update-webkit
    4. Build the framework in debug mode: ./build-webkit --debug
    5. Now, run: ./debug-safari

    Note: It is assumed that you have Xcode and Xcode Command Line Tools installed.