Script Source URLs

We look through script tag arguments looking for source URLs among keyword/value arguments.

script-arguments = <<(argument+ | tag-arguments)>> argument = sp? <<(src-argument | other-argument)>> src-argument = << 'src'i sp? '=' sp? (url-value | value) >> sp? other-argument = << ( name | other-name ) sp? '=' sp? value >> sp? name = <<< ( 'src' | 'language' | 'type' | 'charset') >>> other-name = << [a-zA-Z0-9]+ >>

We're content to find URLs inside double-quoted strings. We parse single quotes just to avoid getting confused by what might be within them.

value = <<(quoted-string | double-quoted-string)>> quoted-string = << quote (!quote .)+ quote >> double-quoted-string = << double-quote (!double-quote .)+ double-quote >>

For now we'll look for only double-quoted urls. This handles 9 out of 10 cases.

url-value = << double-quote (url | other-url) double-quote >> other-url = << (!double-quote .)+ >>

Refinement

Continue matching url.

URL Components especially domain