I'm using addUserScript() to add a user script to my WKWebView's WKUserContentController. I noticed that even if call loadRequest() the script stays around.
For certain use cases I may need to remove certain scripts and add others. However, it seems that the only way to remove scripts is removeAllUserScripts(). This is very inconvenient since it means I would have to remove all scripts and then re-add back the ones which I wanted to keep.
If anyone knows of any way to delete a specific script (by name, handle, etc.) please let me know.