Search-as-you-type with Turbo?

Here’s another thought. If the response to the form submission gives you the right URL, have you tried hooking into turbo:submit-end? Because this would, if it works (I haven’t tried it), address your concern that any change to the frame src can change the URL. It’s also simpler, since you don’t need to mess around with MutationObserver.

// view.html
<form data-turbo-frame="data" data-action="turbo:submit-end->search#updateURL">
</form>

<turbo-frame id="data">
</turbo-frame>

// search_controller.js
export default class extends Controller {
  updateURL() {
    history.pushState(this.frame.src)
  }

  get frame() {
    return document.getElementById(this.element.getAttribute("data-turbo-frame"))
  }
}