How to use devtron - 10 common examples

To help you get started, we’ve selected a few devtron examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Janglee123 / eplee / src / main / index.js View on Github external
async function installDevTools() {
  try {
    // eslint-disable-next-line
    require('devtron').install();
    // eslint-disable-next-line
    require('vue-devtools').install();
  } catch (err) {
    // eslint-disable-next-line
    console.error(err);
  }
}
github Suremotoo / e-tools / main.js View on Github external
break;
        }

        // 然后加载应用的 index.html。
        mainWindow.loadURL(url.format({
            pathname: path.join(__dirname, getLocalLanguagueSetting),
            protocol: 'file:',
            slashes: true
        }))


        // Launch fullscreen with DevTools open, usage: npm run debug
        if (debug) {
            mainWindow.webContents.openDevTools()
            mainWindow.maximize()
            require('devtron').install()
        }


        // 取消引用 window 对象,如果你的应用支持多窗口的话,
        // 通常会把多个 window 对象存放在一个数组里面,
        // 与此同时,你应该删除相应的元素。
        mainWindow.on('closed', function() {
            mainWindow = null
        })

        mainWindow.on('resize', updateReply);

        function updateReply() {
            // const message = `大小: ${mainWindow.getSize()} - 位置: ${mainWindow.getPosition()}`
            // console.log("mainWindow:" + message);
        }
github ConardLi / electron-print-demo / main.js View on Github external
height: 840,
      title: app.getName(),
    }

    if (process.platform === 'linux') {
      windowOptions.icon = path.join(__dirname, '/assets/app-icon/png/512.png')
    }

    mainWindow = new BrowserWindow(windowOptions)
    mainWindow.loadURL(path.join('file://', __dirname, '/index.html'))

    // Launch fullscreen with DevTools open, usage: npm run debug
    if (debug) {
      mainWindow.webContents.openDevTools()
      mainWindow.maximize()
      require('devtron').install()
    }

    mainWindow.on('closed', () => {
      mainWindow = null
    })

    console.log(BrowserWindow.fromId(1));
  }
github lnked / react-starter / src / assets / app / exm.js View on Github external
height: 840,
            title: app.getName(),
        }

        if (process.platform === 'linux') {
            windowOptions.icon = path.join(__dirname, '/assets/app-icon/png/512.png')
        }

        mainWindow = new BrowserWindow(windowOptions)
        mainWindow.loadURL(path.join('file://', __dirname, '/index.html'))

        // Launch fullscreen with DevTools open, usage: npm run debug
        if (debug) {
            mainWindow.webContents.openDevTools()
            mainWindow.maximize()
            require('devtron').install()
        }

        mainWindow.on('closed', () => {
            mainWindow = null
        })
    }
github AgoraIO-Community / Agora-Electron-Quickstart / main.js View on Github external
nodeIntegration: true
      }
    }

    if (process.platform === 'linux') {
      windowOptions.icon = path.join(__dirname, '/assets/app-icon/png/512.png')
    }

    mainWindow = new BrowserWindow(windowOptions)
    mainWindow.loadURL(path.join('file://', __dirname, '/index.html'))

    // Launch fullscreen with DevTools open, usage: npm run debug
    if (debug) {
      mainWindow.webContents.openDevTools()
      mainWindow.maximize()
      require('devtron').install()
    }

    mainWindow.on('closed', () => {
      mainWindow = null
    })
  }
github keybase / client / desktop / renderer / index.js View on Github external
function setupApp (store) {
  setupSource()
  disableDragDrop()
  makeEngine()
  loadPerf()

  if (devStoreChangingFunctions) {
    window.devEdit = (path, value) => store.dispatch(devEditAction(path, value))
  }

  if (__DEV__ && process.env.KEYBASE_LOCAL_DEBUG) {
    require('devtron').install()
  }

  setupContextMenu(electron.remote.getCurrentWindow())

  // Used by material-ui widgets.
  if (module.hot) {
    // Don't reload this thing if we're hot reloading
    if (module.hot.data === undefined) {
      injectTapEventPlugin()
    }
  } else {
    injectTapEventPlugin()
  }

  ipcRenderer.on('dispatchAction', (event, action) => {
    // we MUST convert this else we'll run into issues with redux. See https://github.com/rackt/redux/issues/830
github keybase / client / shared / desktop / renderer / index.js View on Github external
function setupApp(store) {
  setupSource()
  disableDragDrop()
  const eng = makeEngine(store.dispatch, store.getState)
  loadPerf()

  if (__DEV__ && process.env.KEYBASE_LOCAL_DEBUG) {
    require('devtron').install()
  }

  setupContextMenu(electron.remote.getCurrentWindow())

  // Tell the main window some remote window needs its props
  ipcRenderer.on('remoteWindowWantsProps', (event, windowComponent, windowParam) => {
    store.dispatch({type: 'remote:needProps', payload: {windowComponent, windowParam}})
  })

  // Listen for the menubarWindowID
  ipcRenderer.on('updateMenubarWindowID', (event, id) => {
    store.dispatch({type: 'remote:updateMenubarWindowID', payload: {id}})
  })

  ipcRenderer.on('dispatchAction', (event, action) => {
    // we MUST convert this else we'll run into issues with redux. See https://github.com/rackt/redux/issues/830
github keybase / client / shared / desktop / renderer / index.js View on Github external
function setupApp(store) {
  setupSource()
  disableDragDrop()
  makeEngine()
  loadPerf()
  setupAvatar()

  if (devStoreChangingFunctions) {
    window.devEdit = (path, value) => store.dispatch(devEditAction(path, value))
  }

  if (__DEV__ && process.env.KEYBASE_LOCAL_DEBUG) {
    require('devtron').install()
  }

  setupContextMenu(electron.remote.getCurrentWindow())

  // Used by material-ui widgets.
  if (module.hot) {
    // Don't reload this thing if we're hot reloading
    if (module.hot.data === undefined) {
      injectTapEventPlugin()
    }
  } else {
    injectTapEventPlugin()
  }

  ipcRenderer.on('dispatchAction', (event, action) => {
    // we MUST convert this else we'll run into issues with redux. See https://github.com/rackt/redux/issues/830
github meetalva / alva / src / hosts / electron-host / create-window.ts View on Github external
webPreferences: {
			nodeIntegration: false,
			preload: require.resolve('./create-window-preload')
		}
	});

	win.maximize();
	win.loadURL(address);

	win.webContents.on('new-window', e => {
		e.preventDefault();
	});

	// Install development tools in dev mode
	if (electronIsDev) {
		require('devtron').install();

		const {
			REACT_DEVELOPER_TOOLS,
			REACT_PERF,
			MOBX_DEVTOOLS
		} = require('electron-devtools-installer');
		const installDevTool = require('electron-devtools-installer').default;

		await installDevTool(REACT_DEVELOPER_TOOLS);
		await installDevTool(REACT_PERF);
		await installDevTool(MOBX_DEVTOOLS);
	}

	return win;
}
github meetalva / alva / src / electron / create-window.ts View on Github external
// when you should delete the corresponding element.
		CONTEXT.window = undefined;
	});

	// Disable navigation on the host window object, triggered by system drag and drop
	win.webContents.on('will-navigate', e => {
		e.preventDefault();
	});

	win.webContents.on('new-window', e => {
		e.preventDefault();
	});

	// Install development tools in dev mode
	if (electronIsDev) {
		require('devtron').install();

		const {
			REACT_DEVELOPER_TOOLS,
			REACT_PERF,
			MOBX_DEVTOOLS
		} = require('electron-devtools-installer');
		const installDevTool = require('electron-devtools-installer').default;

		await installDevTool(REACT_DEVELOPER_TOOLS);
		await installDevTool(REACT_PERF);
		await installDevTool(MOBX_DEVTOOLS);
	}

	checkForUpdates(win);

	CONTEXT.window = win;

devtron

Electron DevTools Extension

MIT
Latest version published 7 years ago

Package Health Score

45 / 100
Full package analysis

Popular devtron functions