How to access the virtual file system that Repl generates when someone opens a Repl
Warning: Reading the following text requires basic-moderate understanding of the following
- HTML or XHTML
- Data URLs
- File URLs
- Absolute URLs
- Relative URLs
- Bash (the shell language)
The attached Repl contains:
chromium-browser --no-sandbox --start-maximized 'file:///home/runner/BrowserTest/test.xml' "data:text/xml;charset=utf-8,`cat ./test.xml`";
First it opens Chromium Browser which Repl already has, and Repl denies us from installing anything on a Repl, so I can't use Google Chrome, Firefox, TOR, etc.
It opens it with two flags
--start-maximized, which are pretty self explanatory and aren't very cryptic.
It opens the following URLs: 'file:///home/runner/BrowserTest/test.xml', this is a browser URL, that directs to a file of my choice. This is my main problem, refer back to this URL later
cat ./test.xml", this is a dynamic string. It starts with
data:text/xml;charset=utf-8, from that point, it reads my file at
test.xml, which contains the following:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <root xml:lang="en"> <one>1</one> <two>2</two> <hash>#</hash> <three>3</three> <four>4</four> </root>
This would be fine... except that it is anything but fine. Nothing works as expected.
Run the Repl yourself, notice that it doesn't find the file.
Fork the Repl, notice that it's perfectly okay now.
This is because Repl automatically creates a fake Repl with everything that was in my Repl, but secretly uses a different file URL, so you can't damage my repl, but you can do whatever you want with the virtual copy.
This is partially because I'm using an absolute URL, so what about my other link? That's relative, so it should be fine, right? I wish...
URLs don't load anything past the
# or, in English, a hashtag.
This occurs regardless of URL type, Firefox, Google Chrome. I don't know why
I tried encoding the hashtag using
#, but guess what? Lol, we have to encode it using itself... epic fail. It doesn't have a named HTML entity either, which doesn't matter since it's XML anyways.
So, all of that to get to my actual question.
The file URL only works if you own the Repl, when someone else uses it, it generates a new section in place of "file:///home/runner/
BrowserTest/test.xml". The rest is unchanged. Is there a way to identify what the generated URL is?
Repl denies us from installing anything on a Repl
This is just straight up not true, I just installed Firefox last week! You have to use install-pkg.
Just use $PWD/test.xml, or maybe /home/runner/*/test.xml seeing as there aren’t any other xml files to look for.
install-pkg!? Really!? This is great news and will significantly improve what I'm capable of on Repl. Now I know it might be asking for a bit much, but can you make a simple Repl showing how to use it and invite me to it?.
@Highwayman I'm trying to install from files, like files I uploaded, like using wget to get a file from the internet. Like "ChromeSetup.dmg". (I don't think that's the filename, but whatever)
@JadenGarcia Not really, chromium is basically open source chrome, to qoute the internet
Chromium is an open-source browser project that forms the basis for the Chrome web browser.
The biggest difference between the two browsers is that, while Chrome is based on Chromium, Google also adds a number of proprietary features to Chrome like automatic updates and support for additional video formats. I don't know of anything significant chrome can do that chromium can't
@JadenGarcia To base64 encode a file, just do
base64 <file name>. You could also always do
cat <file name> | base64 as well, but that's more to type. You can also pipe it into another file (or the same file) to save it by doing something like
base64 <file name> > <file name>, or just copy and paste from your terminal (would be best if repl.it terminal in this case, but if you are on Linux or have Bash installed on your computer separately, you could do it on your computer as well).
@AmazingMech2418 That's why I mentioned Repl storage, the longer base64 (by about 1/3) will take more space, also I want to be able to edit the source file and just click "run" to see the program adapt to the updated file. I wouldn't want to destroy the file.
@Highwayman The issue is that I have 71MB already used, leaving room for only like 3 more Node.JS server repls and I am working on a project that is around the same size as recreating all of the G Suite apps (docs, slides, sheets, drive, etc.) and improving them, of course, called "iConn" which will need more than 3 more Node.JS servers and I don't have the money to get the hacker plan, so, now you probably see my problem.
@AmazingMech2418 hmmmm make 30 different alts to host them XD idk, 🤷♂️ Try putting it all in one repl, and have them listen on different ports. Since they probably overlap in terms of modules, it will reduce the amount of data you use. Also since server’s keep running on the latest release after they are deleted, you can just make the finished product, start the server, delete the repl, and then start the next server. Maybe that’d work,
@Highwayman You can make it listen on multiple ports? I've tried that before and only port 3000 worked for some reason. However, all of them use the same modules, so any ideas there? The only thing I can think of is using separate html repls with one Node.JS repl, but then, Socket.io wouldn't work.
@AmazingMech2418 yes you can listen on 8080 or 7000 or 3000 or 6000... stuff like that, that’s 4 right there. You can put all of the servers in a single polygott repl and then have them run on the different ports. Maybe I’ll make a repl and test that, but it should be a thing I think.
@MatReiner You do realize that this was one of the original ideas he had, right? He used a data URL in the first code block.
Also, there are multiple things wrong with that data URL:
- He specifically said "XML," and even gave the XML file used, your use of
text/htmlis completely incorrect in this context
utf-8is just plain incorrect. To set the charset, use
dataHere...includes a hashtag, which the writer's XML did, then everything past it, including it, is totally ignored.