<!--  As an open source project with a dedicated but small maintainer team, it can sometimes take a long time for issues to be addressed so please be patient and we will get back to you as soon as we can.
-->

### Preflight Checklist
<!-- Please ensure you've completed the following steps by replacing [ ] with [x]-->

* [x] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
* [x] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
* [x] I have searched the issue tracker for an issue that matches the one I want to file, without success.

### Issue Details

* **Electron Version:**
  * 13.0.0-nightly.20210223
* **Operating System:**
  * Windows 10
* **Last Known Working Electron version:**
  * It probably never worked

### Expected Behavior
Call to BrowserWindow.webContents.capturePage does not freeze the application.

### Actual Behavior
Call to BrowserWindow.webContents.capturePage freezes the application.

### To Reproduce
Run following app:
```
const { app, BrowserWindow } = require('electron')

function startTest() {
  let win = new BrowserWindow();

  win.on('hide', () => {
    // We have to wait a moment as 'hide' is called too soon
    // and windows isn't really hidden at this point.
    setTimeout( () => {
      win.webContents.capturePage();
      app.quit();
    }, 100);
  });

  win.webContents.loadURL('about:blank');
  win.hide();
}

app.on('ready', startTest)
```

<!--
For bugs that can be encapsulated in a small experiment, you can use Electron Fiddle (https://github.com/electron/fiddle) to publish your example to a GitHub Gist and link it your bug report.
-->

<!--
If Fiddle is insufficient to produce an example, please provide an example REPOSITORY that can be cloned and run. You can fork electron-quick-start (https://github.com/electron/electron-quick-start) and include a link to the branch with your changes.
-->

<!--
If you provide a URL, please list the commands required to clone/setup/run your repo e.g.
```sh
$ git clone $YOUR_URL -b $BRANCH
$ npm install
$ npm start || electron .
```
-->

### Screenshots
<!-- If applicable, add screenshots to help explain your problem. -->

### Additional Information
<!-- Add any other context about the problem here. -->

shell/browser/api/electron_api_web_contents.cc
content::WebContents* source,
    std::unique_ptr<content::WebContents> new_contents,
    const GURL& target_url,
    WindowOpenDisposition disposition,
    const gfx::Rect& initial_rect,
    bool user_gesture,
    bool* was_blocked) {
  auto* tracker = ChildWebContentsTracker::FromWebContents(new_contents.get());
  DCHECK(tracker);
  v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
  v8::Locker locker(isolate);
  v8::HandleScope handle_scope(isolate);
  auto api_ontents =
      CreateAndTake(isolate, std::move(new_contents), Type::kBrowserWindow);
  if (Emit("-add-new-contents", api_ontents, disposition, user_gesture,
           initial_rect.x(), initial_rect.y(), initial_rect.width(),
           initial_rect.height(), tracker->url, tracker->frame_name,
           tracker->referrer, tracker->raw_features, tracker->body)) {
    api_ontents->Destroy();
  }
}
content::WebConbContents::OpenURLFromTab(