Originally, I just copied it from the URL bar, but I just realized that there's a way to get it from within the notebook using document.baseURI (I learned this from https://observablehq.com/@jashkenas/url-querystrings-and-hash-parameters), so I've updated that part of the notebook.
Reviewing the rest of this notebook, I noticed that the original technique I used to find the node object associated to a particular cell below no longer works... unfortunately I can't dig further into this right now.
That's true. For a notebook that you're embedding where you have control over the embedding code, you may be able to expose the notebook URL string to the notebook context from the embedding code by either defining a global variable or injecting a cell containing the string into the notebook module (and modifying the inspector so that it doesn't display it). I'm not too familiar with how the newer iframe embedding works, so I don't know what would be possible there.
Sorry if I'm misunderstanding what you want, since I've had to kind of guess. I think you might be able to get more (and higher-quality) ideas if you ask on the forums, as this notebook was just a simple demo (and it seems it's outlived its usefulness).