This question started with a Robot Framework test against a public website with lots of functionality. As part of the data generated by the test, I wanted to capture screenshots. The whole report is formatted as HTML with JavaScript data sources. So RF puts data into the .JS file and the HTML reads it.
I was having problems with the images. They didn't show up up in the popup window report and I couldn't figure out why.

The paths exported from RF were relative and they worked perfectly well from the main page of the report, but not in the popup.

The problem appears to be that a "blank" popup has no window.location from which to search for resources. I even ran a quick experiment to show that the whole path from the main window (left) was not accesible from the popup (right).
Thanks to a comment about absolute vice relative paths, I updated the RF code to output absolute paths. Now my code has the effect I want, but I am left with a remaining question about blank windows and paths.
I can make the images work, but I have style sheets and javascript files that I would also like to refer to. Right now I'm writing everything in line by line which seems excessive. Surely there is a way to setup a path for a new window which can be used as a starting point for relative resources.
I see the imgs are given relative URLs to work with (as they should be). I am not 100% positive what the base URL is for window.open. I don't know if it's about:blank, but since the absolute URLs work and the relative ones don't, I think it's a safe bet that the browser doesn't know where to point to.
So add a element to explicitly tell it where to point. Here is the documentation:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
I assume that you are writing elements to the window with js, so in that case you will want to create the base element, append it to the head and set base.href to the base url you are using.
I think you might save yourself some trouble on things like this by NOT using window.open (which got a really bad rap in the bad days of popups) and use a hidden modal div that you can load (or write) html into, then unhide. However, you might have a completely valid reason for using the popup.