Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

214
Vistas
Can Electron read DOM from BrowserView?

is it possible to read DOM of website with given url in BrowserView? I have code that looks like this one, and Electron is throwing an error: "An object could not be cloned"

  // Create the browser window.
  const mainWindow = new BrowserWindow({
    height: 800,
    width: 1200,
    webPreferences: {
      preload: MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY,
    },
  });

  const view = new BrowserView({
    webPreferences: {
      webSecurity: false,
      allowRunningInsecureContent: true,
    },
  });

  mainWindow.setBrowserView(view);
  view.setBounds({ x: 200, y: 0, width: 900, height: 800 });
  view.webContents.loadURL("https://electronjs.org");
  view.setAutoResize({ width: true, height: true });
  view.webContents
    .executeJavaScript("document.querySelector('body')")
    .then((result) => {
      console.log("html", result);
    })
    .catch((err) => console.log(err));

  // and load the index.html of the app.
  mainWindow.loadURL(MAIN_WINDOW_WEBPACK_ENTRY);

  // Open the DevTools.
  mainWindow.webContents.openDevTools();
};```
about 4 years ago · Santiago Gelvez
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda