# Distorted HTMLAnchorElement#protocol Setter (distorted-html-anchor-element-protocol-setter)

For security the `protocol` setter on `HTMLAnchorElement` is distorted by Lightning Web Security.

<!-- START generated embed: @locker/distortion/src/HTMLAnchorElement/docs/protocol-setter.md -->
## HTMLAnchorElement.prototype.protocol setter

The [`HTMLAnchorElement.prototype.protocol`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement/protocol) property reflects the scheme portion of the anchor's URL. Assigning to it rewrites only the scheme of the current `href`, leaving the rest of the URL in place. This makes it a second way to give an anchor a dangerous scheme without ever assigning a full URL to `href`.

Lightning Web Security rejects scheme assignments whose resulting scheme can trigger arbitrary JavaScript execution: `javascript:`, `data:`, and `vbscript:`. All other schemes are permitted.

### Distorted Behavior

This distortion throws a `LockerSecurityError` when the assignment would leave the anchor with a blocked scheme. The resulting scheme is evaluated as the browser's URL parser normalizes it, so a blocked scheme cannot be disguised with letter-casing, surrounding whitespace, or zero-width characters. Permitted assignments are delegated to the native setter. The check runs before the native setter, so a blocked scheme is never reflected into the element's URL.
<!-- END generated embed, please keep comment -->
