Enable WebKit debugger in FileMaker Web Viewer

If you are having difficulty getting your HTML, CSS, or JavaScript to render in a FileMaker Web Viewer, you may have a struggle ahead of you trying to find the problem, and no good way to debug it. In comparison, most web browsers have debug facilities that can help developers find problems in their code.

It turns out if you are using Mac OS X you can get the same facilities found in Safari to debug your code that’s running in a FileMaker Web Viewer.

 

To do this we need to first enable a hidden option. Quit any open copies of FileMaker and start up the Terminal app to execute one or more versions of the command below.

For FileMaker Pro 14 Advanced (Yes, advanced12 is correct for version 14):

For FileMaker Pro 14:

For FileMaker Pro 12 Advanced or 13 Advanced:

For non-Advanced versions of 12 or 13 use:

Start FileMaker back up, right-click on a Web View, and select Inspect Element from the contextual menu. Voila! You can now debug HTML, CSS, and JavaScript in any Web Viewer.

Web Viewer contextual menu
Safari debugger in Web View

If you are debugging JavaScript and are trying to catch your code in action, there are some minor tricks required.

One issue is that the debugger will go away whenever the Web Viewer is not displayed. Annoyingly, this also takes any breakpoints you’ve set with it. So for debugging JavaScript code you probably want to take advantage to the debugger extensions added to JavaScript. These are documented on table 5-2 of the Safari Inspector Guide.

A partial list of functions are:

  • console.assert(expression, object)
  • console.log(object)
  • console.profile([title])
  • console.trace()
  • debug (expression)
  • debugger

None of these debugger functions will work until the Inspector has been activated, so enable it as soon as possible with the contextual menu on the Web Viewer. But at least the debugger breakpoints will persist each time the web viewer is reloaded.

Simon

5 thoughts on “Enable WebKit debugger in FileMaker Web Viewer

Leave a Reply