| 66 | |
| 67 | export function afterWebStarted(blazor) { |
| 68 | customElements.define('page-script', class extends HTMLElement { |
| 69 | static observedAttributes = ['src']; |
| 70 | |
| 71 | // We use attributeChangedCallback instead of connectedCallback |
| 72 | // because a page-script element might get reused between enhanced |
| 73 | // navigations. |
| 74 | attributeChangedCallback(name, oldValue, newValue) { |
| 75 | if (name !== 'src') { |
| 76 | return; |
| 77 | } |
| 78 | |
| 79 | this.src = newValue; |
| 80 | unregisterPageScriptElement(oldValue); |
| 81 | registerPageScriptElement(newValue); |
| 82 | } |
| 83 | |
| 84 | disconnectedCallback() { |
| 85 | unregisterPageScriptElement(this.src); |
| 86 | } |
| 87 | }); |
| 88 | |
| 89 | blazor.addEventListener('enhancedload', onEnhancedLoad); |
| 90 | } |
nothing calls this directly
no outgoing calls
no test coverage detected