Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web Event Callbacks? #43

Open
CorneliaXaos opened this issue Dec 4, 2017 · 3 comments · May be fixed by #659 or #676
Open

Web Event Callbacks? #43

CorneliaXaos opened this issue Dec 4, 2017 · 3 comments · May be fixed by #659 or #676
Labels
possibly stale This may be stale

Comments

@CorneliaXaos
Copy link

So I noticed the callback function in the webview struct, but I don't think that's what I'm looking for. Namely, I would like to know if there's a way to intercept web events such as page redirects / navigation. A concrete example would be intercepting the redirect of an OAuth 2 application so that you can extract the state information the server returns.

@shivaprsd
Copy link
Contributor

Can't it be done by trapping the event within JS, then signalling the backend
via window.external.invoke_? Don't know if it would work for navigations or
redirects, though.

@CorneliaXaos
Copy link
Author

That's an interesting option... I didn't think of injecting JS into the web page I was loading to try to detect it that way.. I have no control over the content that's loaded within the page.. and I'd have to re-inject the JS every time the user navigated until I detected what I needed.

@shivaprsd
Copy link
Contributor

That's right. And the beforeunload event that needs to be handled does not
seem to fire on macOS.

There are indeed native callbacks for navigation-requests on each platform. It
is only a matter of hooking a common callback to each of them.

This was linked to pull requests Jun 17, 2022
@SteffenL SteffenL added the possibly stale This may be stale label Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
possibly stale This may be stale
Development

Successfully merging a pull request may close this issue.

3 participants