Created
November 16, 2021 17:07
-
-
Save mbifulco/90db16e052d03f7447fe34e862d37a27 to your computer and use it in GitHub Desktop.
How to set url search params without navigating
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const url = new URL(window.location); | |
url.searchParams.set('h', 100); // add hue value here | |
url.searchParams.set('s', 0); // add s value here | |
url.searchParams.set('v', 0); // add v value here | |
// tell the browser to update the URL | |
window.history.pushState({}, '', url); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment