@@ -76,6 +76,26 @@ <h1>Anchor</h1>
7676 </ script >
7777 </ li >
7878
79+ < li >
80+ < strong > get empty a.href properties</ strong >
81+ < div id ="emptyAnchorContainer "> </ div >
82+ < script type ="text/partytown ">
83+ ( function ( ) {
84+ try {
85+ const container = document . getElementById ( 'emptyAnchorContainer' ) ;
86+ container . className = 'emptyAnchorContainer' ;
87+ const elm = document . createElement ( 'a' ) ;
88+ const { hash, host, hostname, href, origin, pathname, port, protocol, search } = elm ;
89+ elm . href = pathname ;
90+ container . textContent = 'Anchor properties: ' + JSON . stringify ( { hash, host, hostname, href, origin, pathname, port, protocol, search } ) ;
91+ } catch ( err ) {
92+ container . textContent = 'An error ocurred: ' + err . message ;
93+ console . error ( err ) ;
94+ }
95+ } ) ( ) ;
96+ </ script >
97+ </ li >
98+
7999 < li >
80100 < strong > constructor.name</ strong >
81101 < div > < a id ="testAnchorConstructor "> </ a > </ div >
@@ -183,8 +203,8 @@ <h1>Anchor</h1>
183203 < li >
184204 < strong > get < a id ="getSearch " href ="https://builder.io/?a=42&b=23 "> search</ a > </ strong >
185205 < div >
186- < strong > search:</ strong > < span id ="testGetSearch "> </ span >
187- < strong > href: </ strong > < span id ="testGetSearchHref "> </ span >
206+ < strong > search:</ strong > < span id ="testGetSearch "> </ span > < strong > href: </ strong
207+ > < span id ="testGetSearchHref "> </ span >
188208 </ div >
189209 < script type ="text/partytown ">
190210 ( function ( ) {
@@ -203,8 +223,8 @@ <h1>Anchor</h1>
203223 < li >
204224 < strong > set < a id ="setSearch " href ="https://builder.io/?a=42&b=23 "> search</ a > </ strong >
205225 < div >
206- < strong > search:</ strong > < span id ="testSetSearch "> </ span >
207- < strong > href: </ strong > < span id ="testSetSearchHref "> </ span >
226+ < strong > search:</ strong > < span id ="testSetSearch "> </ span > < strong > href: </ strong
227+ > < span id ="testSetSearchHref "> </ span >
208228 </ div >
209229 < script type ="text/partytown ">
210230 ( function ( ) {
0 commit comments