8000 window.opener opened from webview is null after cross site navigation · Issue #18032 · electron/electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
window.opener opened from webview is null after cross site navigation #18032
Closed
@hugomano

Description

@hugomano

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version:
    5.0.0
  • Operating System:
    macOS 10.14.4
  • Last Known Working Electron version::
    4.0.4

Expected Behavior

Open a Window with domain A via window.open et navigate to domain B in the opened window should keep the window.opener reference.

At the business logic level, sign-in with Google Auth from a web frame doesn't work. The callback on final application domain can't post a message to the window opener.

Actual Behavior

The window.opener is null after cross-site navigation.

To Reproduce

// main.js

const { app, BrowserWindow } = require('electron')

function createWindow() {
  const mainWindow = new BrowserWindow({
        webPreferences: {
          nodeIntegration: true,
          webviewTag: true,
          contextIsolation: false,
        }
  });

  mainWindow.loadFile('index.html')
}

app.on('ready', createWindow)
app.on('window-all-closed', app.quit);
  <webview src="https://mail.google.com" allowpopups></webview>
  • Call window.open('https://google.com') from the web view dev tools
  • The window.opener is not null
  • Go to Github with window.location = 'https://github.com'; the window.opener is null

Screenshots

Additional Information

Similar issues have been reported: #17869,
#15821, #8100

Also preloads doesn't load in the same origin context for the opened window.
Seems linked to #17989:

  • Web view (myapp.com) open auth.google.com, window.opener is null and preloads are loaded
  • Web view (myapp.com) open auth.myapp.com, window.opener is set but preloads are not loaded

More details here
History: #11471 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0