The current page URL path (without origin)
// With meta tag
// <meta name="99dev-page" content="https://example.com/about">
getURL(); // returns "/about"
// With hash navigation
// URL: https://example.com/#/products
getURL(); // returns "/products"
// With History API
// URL: https://example.com/products?page=2
getURL(); // returns "/products
// With History API and state
// history.pushState({ url: '/custom-path' }, '', '/products')
getURL(); // returns "/custom-path"
Gets the current page URL based on navigation type and available meta information. The function follows this priority order:
For History API navigation, the function will: