Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

521
Visualizações
electron: google 403 We're sorry, but you do not have access to this page. That’s all we know

I'm developing an electron application. When I load the google login page using iframe, I get an error: '403. That’s an error. We're sorry, but you do not have access to this page. That’s all we know.'

How can I skip this error and get the google login page?

Q: Why not use an electron window to load the google login page?

A: It's true that using an electron window to load the google login page doesn't have any errors! But electron window will consume more memory!

Please help me!

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Display external web content in an isolated frame and process.

Process: Renderer This class is not exported from the 'electron' module. It is only available as a return value of other methods in the Electron API.

Use the webview tag to embed 'guest' content (such as web pages) in your Electron app. The guest content is contained within the webview container. An embedded page within your app controls how the guest content is laid out and rendered.

Unlike an iframe, the webview runs in a separate process than your app. It doesn't have the same permissions as your web page and all interactions between your app and embedded content will be asynchronous. This keeps your app safe from embedded content. Note: Most methods called on the webview from the host page require a synchronous call to the main process.

Reference

if you are using iframe for google sign you will get a content security policy (CSP) error A result like this

enter image description here

<iframe style="display: flex ;height: 1000px" width="100%" height="100%"
        src="https://accounts.google.com/signin/v2/identifier?service=mail&passive=1209600&osid=1&continue=https%3A%2F%2Fmail.google.com%2Fmail%2Fu%2F0%2F&followup=https%3A%2F%2Fmail.google.com%2Fmail%2Fu%2F0%2F&emr=1&flowName=GlifWebSignIn&flowEntry=ServiceLogin"></iframe>

Solution:

Electron already introduced a webview tag

So The result may like this

enter image description here

    <webview style="
height: 500px;display: flex"  src="https://accounts.google.com/signin/v2/identifier?service=mail&passive=1209600&osid=1&continue=https%3A%2F%2Fmail.google.com%2Fmail%2Fu%2F0%2F&followup=https%3A%2F%2Fmail.google.com%2Fmail%2Fu%2F0%2F&emr=1&flowName=GlifWebSignIn&flowEntry=ServiceLogin"  ></webview>

NB:

You must add the webPreferences property in Browserwindow and the webview tag must be true otherwise the view tag will be hidden. The default webview tag is false .like this

enter image description here

So you must add like this

 function createWindow() {
    win = new BrowserWindow({width: 800, height: 600, webPreferences: {webviewTag: true}})
    win.loadURL(url.format({
        pathname: path.join(__dirname, 'index.html'),
        protocol: 'file:',
        slashes: true
    }))
}
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda