2
6 Comments

Website loading as a service?

Does anyone have suggestions on a service that will simply load a given URL in a browser, as a service?

My use case is that I need to verify that users on my platform have correctly configured their site to load an external javascript file that I hand them, that will ping my server from their domain to "prove" that it's been setup correctly.

Would greatly appreciate any input :)

on July 31, 2020
  1. 1

    How about setting a puppeteer or selenium-like solution in your backend? Puppeteer or its python-port (pyppeteer) are easy to set up within about 2 hours (if your backend is node or python)

    1. 1

      Yeah, I was just thinking to do that as well. I actually finally settled on having my app itself open a new tab when the user gets to the "verify domain" step. Should simplify things a lot.

  2. 1

    Why couldn't you just use your server to determine this? Have a token in URL to the script that identifies the site, and when visitors hit it they'll load it. You could also have that external JS call your server from the user's browser with the same token?

    1. 1

      Yeah, that's the plan, but I need to somehow trigger a site load as part of an onboarding flow to verify that the script was installed.

      1. 1

        Just use a cURL/GET request and parse the page for it. Otherwise you're going to just be DDoSing your own server eventually.

        1. 1

          I thought about this too, but just checking to see if a script looks like it should run, doesn't really mean it will in practice. There's all sorts of typos.

          I think I've solved this by making it conditional on a unique query parameter being present before that call is made to my server. Should ensure that it's not done by accident, or on every page load to the users site.