I have a html document in memory as a string. It contains a tag with a little script that manipulates the dom. I now want to load that html page
If you don't want to create a file or load a URL before being able to replace the content of the page, you can always leverage the Data URLs feature, which supports HTML, CSS and JavaScript:
ChromeDriver driver = new ChromeDriver();
html_content = """
Hello World =)
"""
driver.get("data:text/html;charset=utf-8," + html_content)