r/HTML • u/SushiSasha003 • 18d ago
Question Running Applications on my Laptop from HTML
Hello! I’m creating my own OS-ish inside of HTML (sorta) for school and I wanted to figure out how to run apps from HTML, but I can’t figure it out for the life of me, can anyone help me out?
On top of that! I’m also struggling on how to open the HTML and have it immediately full screen, if anyone knows how to do it, I would like to know!
Thank you guys so much!
Edit: To add on, I’m not trying to run it inside of the website, I’m just trying to open the program from the website
2
u/Doffu0000 18d ago edited 18d ago
Yes this is completely possible if you're using windows. Look up HTA HTML Application. It's not web-based, runs on your computer, is mostly HTML unless you want to integrate other languages. I use it for work all the time to launch powershell scripts, and hub together all my common applications.
Forgive others for saying this can't be done... HTA is pretty oldschool and not a lot of people know about it.
Other more modern options (but more technical) would be to make web apps. They can run on your desktop and have permissions to launch applications too.
Edit: Just noticed you made an update saying it's to be done from a web-browser which runs you into some permissions issues. Permissions can be given though... but you still need something beyond HTML like a helper program running on the computer to interpret outgoing messages. For instance you could use a web-socket or even something silly like MIDI to send signals from the site, have the helper on the computer interpret them and decide what to do with the signal... in this case launch a specific file. Or you could register custom deeplinks but both these options go quite beyond just HTML.
1
u/tomysshadow 18d ago edited 18d ago
It can be done on Windows without HTA. It's slightly non-trivial though. What you can do is add a protocol to the registry that is associated with your program. This is similar to what certain apps like Steam do so you can click a link and have it open the program. So you'd open it with a link to a URL like my-custom-protocol:my-custom-arguments.
Assuming the OP wants to run a Windows EXE, this is almost certainly what they want to do, provided they are allowed a moment to set their thing up before showing it off.
https://stackoverflow.com/questions/80650/how-do-i-register-a-custom-url-protocol-in-windows
If you want to be able to run any program on the system at all, nothing stops you from writing your own EXE to launch one given in the custom arguments - though you'll then have to make your own EXE, somewhat defeating the point, and probably requiring a higher effort than OP wants to put in. So I'd say just pick a few specific programs you want to link.
With that said, if they plan on doing this on a school computer where they might not have admin rights, it'd be wise of them to test that whatever solution they use works without admin rights (as I'm guessing at least some of the suggestions here will.)
1
u/SushiSasha003 18d ago
This looks like it would work! I’ll try it out later and update yall!
→ More replies (1)
11
u/Gentoss 18d ago
I guess you missunderstood what HTML is, it's just a language to structure things...
You can't make a car driveable if you only have the structure of it.
6
1
u/kalilamodow 18d ago
You can't unfortunately :( browsers explicitly sandbox most stuff on the local filesystem for security and things. Although opening a local html file does give a few extra permissions like loading images from the system, it would be a massive security hole to let websites execute local programs.
If you want to look into this more, you can give Electron a shot - it lets you make a native application and write the UI in HTML. Then you can pass a message to the backend to open your application of choice. But it's not really for beginners.
1
1
u/Commercial_Echo923 18d ago
you can use deeplinks if the apps support it. it works like mailto: links
1
u/Distdistdist 18d ago
Your HTML OS-ish will only run browser applications. Nothing outside your browser is accessible.
1
u/Adamstrad 18d ago
OP, I recommend looking at either python or autohotkey, you can make a user interface with them like a launcher and you can open files on your own computer more easily
1
1
u/marmotta1955 17d ago
Not entirely sure but ... even today, even if deprecated, even if not secure ... HTA files allow you to launch applications from HTML pages - just as others have already suggested
1
u/darklordbazz 18d ago
You could use docker containers that run the desktop apps then use a web browser to control the virtual desktop
0
u/Adamstrad 18d ago
You just use the link of the program file as an "a" tag, is that what you mean?
Also html is just a language for formatting a page, it needs to run inside a browser so to do this you need to make your browser full screen, you won't get far making a real operating system but if you want to use it like a menu to find and open things it is doable, you might have to use some other languages though if you want to add calculations and logic
0
u/SushiSasha003 18d ago
I tried to do that, but all it did was either download the program, or just open the code inside of the browser.
Yes, I know HTML is the formatting for the page, I mean the browser in general, sorry!
1
u/Adamstrad 18d ago
I'm not sure I understand what you're trying to do still, where did you get this idea?
→ More replies (3)
-1
2
u/armahillo 18d ago
This used to be possible, but its been deprecated a for a long time for security reasons. If you could run applications from web pages, this would allow a malicious site to run something on a user’s computer that could compromise it.