Currently, I am using addUserScript() to insert a user script into my WKWebView's WKUserContentController. An issue that I've encountered is that even after calling loadRequest(), the added script remains in place.
In certain scenarios, I might need to remove specific scripts and then add others. Unfortunately, it appears that the only method available for removing scripts is removeAllUserScripts(). This poses an inconvenience as it requires me to remove all scripts and subsequently re-add the ones that are needed.
If anyone has insight on how to delete a particular script based on its name, handle, or any other identifier, I would greatly appreciate your input.