Is it possible to take code from a website and turn it into a bookmarklet without having it attached to the link?

The title probably does a horrible job at explaining this, but I didn’t know how to word it any better. If someone wants to edit that go ahead.

On to the point, I want to take code from a website my friends made and make it a bookmarklet that turns your screen into that website without actually bringing you to the website, if that makes sense. (they know I want to do this and are ok with it)

I found this code that replaces whatever is currently on your screen:
Code

But I don’t know how to or if I can even make it show a entire website. Another problem with this is the website uses multiple pages and multiple coding languages (HTML, CSS, JS, and pages to store the code I think) and bookmarklets were made for Javascript specifically and one page I think, unless i’m wrong.

Sorry if this appears to be a blatantly obvious or dumb question, I am very new to Javascript and this is probably a big thing to even try to do for someone who just started but I feel like doing it and unless it’s impossible I will do it lol.