Skip to content

Commit

Permalink
Run URL parser to determine URL protocol. (#248)
Browse files Browse the repository at this point in the history
* Run URL parser
* Update index.bs

Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
  • Loading branch information
otherdaniel and annevk authored Jan 10, 2025
1 parent 0e58018 commit 3604c34
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -471,12 +471,21 @@ template contents). It consistes of these steps:
[=Attr/namespace=] is `null` and
|configuration|["{{SanitizerConfig/dataAttributes}}"] is true
1. If |handleJavascriptNavigationUrls| and &laquo;[|elementName|, |attrName|]&raquo; matches an entry in the
[=built-in navigating URL attributes list=], and if |attribute|'s [=protocol=] is
"`javascript:`":
[=built-in navigating URL attributes list=], and if |attribute|
[=contains a javascript: URL=]:
1. Then remove |attribute| from |child|.

</div>

<div algorithm>
To determine whether an |attribute| <dfn>contains a javascript: URL</dfn>:
1. Let |url| be the result of running the [=basic URL parser=]
on |attribute|'s [=get an attribute value|value=].
1. If |url| is `failure`, then return false.
1. Return whether |url|'s [=url/scheme=] [=string/is=] "`javascript`".

</div>

## Configuration Processing ## {#configuration-processing}

<div algorithm>
Expand Down

0 comments on commit 3604c34

Please sign in to comment.