How to modify the current URL without redirection

Hi!

I am looking to change the display of an url https://example.com/?param1=true to https://example.com/ without loading the new webpage.

I am coding an extension for a website giving us the ability to load settings through GET parameters, but my users want to be able to easily copy a clean URL without their own parameters in order to share it.

I tried the history.deleteUrl() and history.addUrl() methods but it actually only modifying the history, not the current URL.

Thanks.

It seems it would be dangerous to let pages show a different URL than the one for the current page, so perhaps there isn’t an API for that.

What about a Copy URL button?

That’s what I thought, but I asked before abandoning the idea.

Yeah, I’ll probably end up with a button. Especially because I don’t want to use too much permissions.