Problem with passing URL parameters into a wiki stored on Sharepoint/WebDAV

Hello,

I have been experimenting with passing parameters of the form:
https://tiddlywiki.com/?some=parameters&someother=parameter2
and using those parameters to set some defaults using a startup tiddler that parses $:/info/url/search.

It likely works fine normally except that when I try to save the Tiddlywiki back to Sharepoint, I get a 400 error. I suspect that it is a problem with the save command sent back to the server containing the extra parameters not matching the filename opened but I don’t know the intricacies of the protocol. Is that the expected WebDAV behaviour or is that a bug?

To work around it, I tried to reset the URL using the tm-home message before saving but, while it clears the # permalink additions, it does not clear the ? and parameters. Is tm-home supposed to clear everything? Is there a different tm to use? If not, could there be?

Thanks,
/Mike

I have sort of figured out a solution. Using my cargo-cult knowledge of JavaScript and some AI search results, I have inserted the following into the tm-home message listener in $:/core/modules/startup/story.js in order to overload it with the functionality that I wanted:

$tw.rootWidget.addEventListener("tm-home",function(event) {

...

let currentURL window.location.href;
let basePath currentURL.split("?")[0];
let newURL= basePath;
window.history.replaceState(null, document.title, newURL);

...
});

It works by adding tm-home message into to PostRender to truncate the “search” part of the URL after parsing it.

I don’t really want to carry modifications to the core js files in my wiki for obvious maintainability issues. Can I ask someone with more JavaScript expertise to put this in another tm-truncate message listener that will be loaded separately as a plug-in? Or at least point me to some example I can follow.

Thanks,
/Mike