r/HTML • • Oct 08 '26

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

0 Upvotes

33 comments sorted by

2

u/armahillo Expert Oct 09 '26

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.

1

u/SushiSasha003 Oct 09 '26

Yeah, I know, but I plan on using it for personal use, so I’m not worried about other people right now.

1

u/armahillo Expert Oct 09 '26

Thats not the point.

Im pretty sure its not possible anymore because of the reasons I described.

0

u/[deleted] Oct 09 '26

[deleted] — view deleted comment

1

u/armahillo Expert Oct 09 '26

This sounds like it would be _way_ beyond the project’s specs / resources

0

u/[deleted] Oct 09 '26

[deleted] — view deleted comment

1

u/zumpiez Oct 09 '26

This is a student.

1

u/armahillo Expert Oct 09 '26

Im talking about the technology that the OP was saying they were trying to use; just an HTML document.

1

u/voodoostevie Oct 09 '26

IIRC this was back with Windows 98 you could make HTML applets on the desktop.

You cannot do this anymore with HTML but there are JScript and other languages that can create a desktop feel to a website. Like the WordPress OpenStation plugin.

1

u/armahillo Expert Oct 09 '26

Yup! Win95 too — ActiveX allowed this.

It got VERY exploited

2

u/Doffu0000 Oct 09 '26 edited Oct 09 '26

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 Oct 09 '26 edited Oct 09 '26

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 Oct 09 '26

This looks like it would work! I’ll try it out later and update yall!

1

u/tomysshadow Oct 09 '26 edited Oct 09 '26

btw, for your fullscreen problem - there isn't a way to have a website open in fullscreen without any user interaction. That is on purpose because otherwise, you could just be surfing the web only to have some website you go to suddenly hijack your whole screen, which would suck. So, the rule is you're only allowed to enter fullscreen if the user clicks something on the page first.

Now, if I were you, I would use this as an opportunity to get creative, maybe add some theatrics. For example: you could show a picture of a computer with a power button on it. When you press the power button, show the computer turn on with your OS inside. Then you can enter fullscreen, because clicking the power button counts as interacting with the page, so now you have permission to enter fullscreen. So you could turn that limitation into a reason to have a cool little intro. Just to give maybe some inspiration.

But, if you don't have time for that - you'll just need to add a button like "click here to start" in order to go to your fullscreen OS.

You'll want to use the Fullscreen API in JavaScript to do it. Don't forget that you'll need to put the code to enter fullscreen in an event handler like onclick, otherwise it won't work, like I said: https://developer.mozilla.org/en-US/docs/Web/API/Fullscreen_API/Guide

11

u/Gentoss Oct 08 '26

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

u/Squishybootz666 Oct 09 '26

This red car paint wont start

2

u/DirtAndGrass Oct 09 '26

That'd be css in this analogy 

1

u/kalilamodow Oct 09 '26

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

u/SushiSasha003 Oct 09 '26

Alright! Thanks for the suggestion, I’ll look into it!  -^

1

u/NetSage Intermediate Oct 09 '26

Sounds like you're trying to make a web app.

https://www.electronjs.org/

Tends to be the go-to option.

1

u/Commercial_Echo923 Oct 09 '26

you can use deeplinks if the apps support it. it works like mailto: links

1

u/Distdistdist Oct 09 '26

Your HTML OS-ish will only run browser applications. Nothing outside your browser is accessible.

1

u/Adamstrad Oct 09 '26

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

u/Adventurous_Push_615 Oct 09 '26

Why not run apps in the browser completely using WebAssembly?

1

u/marmotta1955 Oct 09 '26

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 Oct 09 '26

You could use docker containers that run the desktop apps then use a web browser to control the virtual desktop

0

u/Adamstrad Oct 09 '26

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 Oct 09 '26

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 Oct 09 '26

I'm not sure I understand what you're trying to do still, where did you get this idea?

1

u/SushiSasha003 Oct 09 '26

Well, I’m kind of making something like a launcher you can say

1

u/Adamstrad Oct 09 '26

I see, what do the links look like that you are putting in to open programs? I don't know if it will work with apps but it should work if you use the link for a program on a computer, something like C:\programfiles\program.exe

1

u/zumpiez Oct 09 '26

This will not launch an application. This will, at best, try to download it using the file:/// protocol and maybe not even that because of security.

-1

u/krisleslie Oct 09 '26

I think you misunderstand technology