What happens when JavaScript and Flash are parsed

When using the parse method of analysis, the content scan can only find URLs inside JavaScript™ and Flash components.

When parsing, a string is considered a URL if one or both of the following statements is true:

  • The string occurs in a context that suggests it might be a URL.
  • The string matches one of the search expressions listed.

When parsing URLs in JavaScript and Flash movies, the text of the URL must match a particular pattern. The default patterns that are provided find the majority of strings that might be URLs; however, if these do not work for your site you can add more patterns. Conversely, if the parser settings find URLs that you do not want to be found, you can specify patterns to exclude from the parser search.

Parsing JavaScript

The Parse Javascript to discover URLs option provides better performance than executing JavaScript on your site; however, it only covers a limited number of cases. The parsing method does not run the code. If any strings are found that match the list of expressions, they are scanned as URLs.

For example, when parsing JavaScript the scan treats relative URLs found as relative to the page containing a JavaScript file reference. However, the page containing the JavaScript reference might be in a different location than the actual file being checked, possibly resulting in URLs being reported as broken, when in fact they might not be.

It is also possible that the URLs constructed from the patterns will be incorrect. For example, if a URL given in the code is only partial, because it is based on another factor supplying the remaining part, then the URL will be incorrect. It might not even be recognized as a URL, because it is divided into a number of parts that are assembled into a URL when the script is executed.

Note: Generally, finding valid URLs by parsing JavaScript is not as accurate as executing JavaScript.