Pre-filling fields based on query parameters in the URL

Ok this is a total hack, but I couldn’t find a “Strapi way” of doing this. In the bootstrap method of src/admin/app.js, you can do something like this:

bootstrap(app) {
    const pathname = window.location.pathname

    if (
      pathname.startsWith('/admin/content-manager/') &&
      pathname.endsWith('/create')
    ) {
      const params = new URLSearchParams(window.location.search)

      const tests = {}

      for (const [key, value] of params.entries()) {
        const currentInterval = setInterval(function () {
          const element = document.getElementById(key)

          if (element) {
            element.value = value
            window.clearInterval(currentInterval)
          }

          if (tests[key] == undefined) {
            tests[key] = 0
          }

          tests[key] = tests[key] + 1

          if (tests[key] >= 20) {
            window.clearInterval(currentInterval)
          }
        }, 200)
      }
    }
  },

Although this seems to only work for simple text fields