Instructions
Set URL Parameters:
Sets or updates URL query parameters based on key-value pairs without reloading the page.
Inputs:
- params_kv: List of key-value pairs to set as URL parameters
- replace_history: If true, replaces current history entry (back button won't show this change).
If false (default), creates new history entry.
Behavior:
- Parameters with values will be set or updated
- Parameters with empty/null values will be removed
- Existing parameters not in the list remain unchanged
Example: [{key: "id", value: "123"}, {key: "filter", value: "active"}]
Result: Updates URL to ?id=123&filter=active
Clean Empty URL Parameters:
Removes all URL parameters that have empty, null, or whitespace-only values without
reloading the page.
This action scans all existing URL parameters and cleans up any that don't contain
meaningful values, resulting in cleaner, more professional-looking URLs.
Example:
Before: ?id=123&filter=&search=&status=active
After: ?id=123&status=active
Note: Uses replaceState by default to avoid cluttering browser history.