Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. JavaScript
  4. Application is "dead" when I open it in a browser

Application is "dead" when I open it in a browser

Scheduled Pinned Locked Moved JavaScript
javascriptcsharpvisual-studiohtmldatabase
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    arnold_w
    wrote on last edited by
    #1

    My colleague, who is on vacation, wrote a Javascript application that I need to port to C#. I know nothing about Javascript so at this point I'm happy if I'm just able to execute it successfully. There is a file called "index.html" and when I open this in Chrome I can see buttons, textboxes, comboboxes, etc but everything is "dead" , nothing happens when I e.g. click a button. Does anybody know how I can bring the application to life? Also, does anybody know if there exist a free IDE where I can edit the source code (it would be a bonus if I can step the code as well)? Updated information: I installed "Visual Studio Code" and opened the project folder there and when I click "Start Debugging" I see the GUI flashing by quickly and then nothing happens. In the "Terminal" window I see the following: "npm run start Debugger attached. > firmwareprogrammer@1.0.0 start > electron . Debugger attached. Main process started Waiting for the debugger to disconnect... Waiting for the debugger to disconnect..." Updated information again: I'm now able to step the code in "Visual Studio Code" and when the following function is executed, the GUI-windows are showing (but they are all white), but as soon as the function is finished executing the GUI-windows disappear:

    function createWindow () {
    mainWin = new BrowserWindow({
    width: 1100,
    height: 870,
    minWidth: 1100,
    maxWidth: 1100,
    minHeight: 870,
    maxHeight: 870,
    webPreferences: {
    nodeIntegration: true,
    contextIsolation: false,
    enableRemoteModule: true,
    // preload: path.join(__dirname, "preload.js")
    }
    })

    // mainWin.removeMenu();
    // win.loadFile('index.html')
    //require("@electron/remote/main").enable(win.webContents);
    //mainWin.webContents.openDevTools()
    devtools = new BrowserWindow();
    mainWin.webContents.setDevToolsWebContents(devtools.webContents)
    mainWin.webContents.openDevTools({ mode: 'detach' })

    mainWin.loadURL(url.format({
    pathname: path.join(__dirname, 'index.html'),
    protocol: 'file',
    slashes: true
    }))
    mainWin.webContents.openDevTools()
    mainWin.on('close', () => {
    mainWin = null;
    })
    }

    J 1 Reply Last reply
    0
    • A arnold_w

      My colleague, who is on vacation, wrote a Javascript application that I need to port to C#. I know nothing about Javascript so at this point I'm happy if I'm just able to execute it successfully. There is a file called "index.html" and when I open this in Chrome I can see buttons, textboxes, comboboxes, etc but everything is "dead" , nothing happens when I e.g. click a button. Does anybody know how I can bring the application to life? Also, does anybody know if there exist a free IDE where I can edit the source code (it would be a bonus if I can step the code as well)? Updated information: I installed "Visual Studio Code" and opened the project folder there and when I click "Start Debugging" I see the GUI flashing by quickly and then nothing happens. In the "Terminal" window I see the following: "npm run start Debugger attached. > firmwareprogrammer@1.0.0 start > electron . Debugger attached. Main process started Waiting for the debugger to disconnect... Waiting for the debugger to disconnect..." Updated information again: I'm now able to step the code in "Visual Studio Code" and when the following function is executed, the GUI-windows are showing (but they are all white), but as soon as the function is finished executing the GUI-windows disappear:

      function createWindow () {
      mainWin = new BrowserWindow({
      width: 1100,
      height: 870,
      minWidth: 1100,
      maxWidth: 1100,
      minHeight: 870,
      maxHeight: 870,
      webPreferences: {
      nodeIntegration: true,
      contextIsolation: false,
      enableRemoteModule: true,
      // preload: path.join(__dirname, "preload.js")
      }
      })

      // mainWin.removeMenu();
      // win.loadFile('index.html')
      //require("@electron/remote/main").enable(win.webContents);
      //mainWin.webContents.openDevTools()
      devtools = new BrowserWindow();
      mainWin.webContents.setDevToolsWebContents(devtools.webContents)
      mainWin.webContents.openDevTools({ mode: 'detach' })

      mainWin.loadURL(url.format({
      pathname: path.join(__dirname, 'index.html'),
      protocol: 'file',
      slashes: true
      }))
      mainWin.webContents.openDevTools()
      mainWin.on('close', () => {
      mainWin = null;
      })
      }

      J Offline
      J Offline
      jschell
      wrote on last edited by
      #2

      No idea where to start with this. A javascript "application" is not the same as a "web server" which responds to requests and which might use javascript. So at least from your description it is not clear that you know what it is. If it is a web server then, of course, the first step is that you either must set up a web server or have something that will act as a container (proxy) to run it as though it was in a web server. If it is an application instead then it has nothing to do with a browser. A 'index.html' suggests a web application. Hard to say how you might run this but I know that can be used in IIS with the appropriate AppPool (and other stuff set up). Then IIS is the web server. With my very limited experience node.js might be set up in a similar way. There are other ways this can be setup. Regardless though it likely requires additional steps besides just identifying the container. ------------------------------------------------------------------ Other than the above your company has a SEVERE problem with documentation. This is not something that you should be guessing about. What if your coworker just left the company (fired, quit, died) then what? Production setups should ALWAYS be documented. Development setups should be documented in such a way that it does not require another developer working full time just to get a new developer up and running. Detail helps but it not required.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups