Click here to Skip to main content
15,671,149 members
Articles / Programming Languages / Javascript
Posted 24 May 2023


1 bookmarked

Lavoro - Web-based Approach for Operating System Development

Rate me:
Please Sign up or sign in to vote.
1.50/5 (3 votes)
24 May 2023CPOL
Description of the Lavoro web operating system
We propose the solution for web-based operating systems like Lavoro project which utilizes the COM interoperability for better handling of the URL-based file system


We give the usage of the interop-operations in .NET and implementation of the virtual file system based on the links to URL of the object around the web.


The background is to be the way C# allows the programmable access to the public methods inside class through WebBrowser control element:

    public partial class MainForm : Form


This is far not last to mention that method is then defined with public modifier:

public void UpdateFiles(String s) {
    File.WriteAllText(FilesPath, "var files = [" + s + "];", Encoding.UTF8);
    this.webBrowserFile.Navigate(new Uri(BrowserPath));    


Using the code

The external keyword is reserved for calling .NET methods which are defined as public above:

function addFile(file) {
function updateFilesNET() {
    var r = "";
    for (var e in files) {
        if (r.length > 0) {
            r += ",";

        r += "{ url: '" + files[e].url + "', cookie: '" + files[e].cookie + "'}";

function previewFileNET(vurl, vcookie) {
    window.external.PreviewFile(vurl, vcookie);

function addFileNET(vurl, vcookie) {    
    addFile({ url: vurl, cookie: vcookie});
var index = -1;
function removeIndex(e, i, a) {
    return i != index;
function removeFile(i) {
    index = i;
    files = files.filter(removeIndex);

The script functions from above code snippet can be called via InvokeScript method inside WebBrowser .NET class:

public void AddFile(String url, String cookie) {
    this.webBrowserFile.Document.InvokeScript("addFileNET", new string[] { url, cookie });
    this.webBrowserFile.Navigate(new Uri(BrowserPath));


Points of Interest

Thus, we have learned the interoperability being on the guard for the crucial tasks like web operating system development. We have provided the quick and simple access to the resources the operating system is eligible to manage.

In our code more than COM Interop can be learned, like resizing of the web elements on the form.


25th of May 2023 - Initial release.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Comments and Discussions

-- There are no messages in this forum --