Giter Site home page Giter Site logo

Comments (4)

coderaiser avatar coderaiser commented on May 17, 2024

Скорее всего дело в поле node-integration конструктора BrowserWindow.
lib/util.js использует глобальные переменные, только если нет module.exports
Вот пример Cloud Commander в Electron (который раньше назывался Atom Shell).

from cloudcmd.

coderaiser avatar coderaiser commented on May 17, 2024

Если нужен включенный node-integration, можно подключить preload таким образом:

mainWindow = new BrowserWindow({
  width: 800,
  height: 600,
  webPreferences: {
    preload: __dirname + '/preload.js'
  }
});

В preload.js удалить переменные связанные с module, module.exports (согласно документации electron:

window.nodeRequire = require;
delete window.require;
delete window.exports;
delete window.module;

либо подключить все используемые модули, через require и сохранить их в global scope:

require('module').globalPaths.push(__dirname + '/node_modules');
try {
window.exec = require('execon');
window.Util = require('cloudcmd/lib/util');
window.CloudFunc = require('cloudcmd/lib/cloudfunc');
window.input = require('cloudcmd/lib/client/input');
[
  'rendy',
  'smalltalk'
].forEach((name) => {
  window[name] = require(`cloudcmd/modules/${name}`);
});

window.rendy = require('cloudcmd/modules/rendy');
window.smalltalk = require('cloudcmd/modules/smalltalk');
window.$ = window.jQuery = require('cloudcmd/modules/jquery/dist/jquery.min');
window.join = require('join-io/www/join');
window.load = require('console-io/modules/load/load');
window.skipfirst = require('console-io/modules/skipfirst/lib/skipfirst');

[
  'edward',
  'dword',
  'spero',
  'remedy',
  'ishtar'
].forEach((name) => {
    window[name] = require(`${name}/lib/client`);
});
} catch(error) {
  alert(error);
}

from cloudcmd.

zkochan avatar zkochan commented on May 17, 2024

I would love to try cloud commander as a substitution of total commander, is there a separate project that can install an electron version of cloud commander? If not, Is it documented somewhere how to do it manually?

(you can answer in Russian or Ukrainian if you wish. I speak those languages)

from cloudcmd.

coderaiser avatar coderaiser commented on May 17, 2024

@zkochan no there is no such project, but you can use https://github.com/cloudcmd/electron as starting point.

from cloudcmd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.