-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Captcha resolution wasn't IPC compatible. It depended on the renderer process having direct access to `window` in a way that hasn't been true since we upgraded to Electron 12. The current event flow for captcha resolution is a bit roundabout, in that it moves from: contained webview -> main process -> renderer process This could conceivably be shortened, but I don't know that its necessarily valuable to pursue
- Loading branch information
Showing
6 changed files
with
50 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
interface ExtWindow { | ||
onCaptcha: (response: string) => void; | ||
captchaResponse: string; | ||
} | ||
const extWindow: ExtWindow = window as any; | ||
import { contextBridge } from "electron"; | ||
import { emitSyncIpcEvent } from "common/ipc"; | ||
import "@goosewobbler/electron-redux/preload"; | ||
|
||
extWindow.onCaptcha = function (response: string) { | ||
extWindow.captchaResponse = response; | ||
}; | ||
contextBridge.exposeInMainWorld("onCaptcha", function (response: string) { | ||
emitSyncIpcEvent("onCaptchaResponse", response); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters