MCPcopy Create free account
hub / github.com/MackinnonBuck/blazor-page-script /

Class

src/wwwroot/BlazorPageScript.lib.module.js:68–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66
67export 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected