Boscop / Boscop/web-view

[enhancement] Trapping basic authentication and other popups.

Open
#139 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2k
Forks
179
PR merge metrics
No merged PRs in 30d

Description

As far as I can tell this isn't implemented and im not sure if its possible with web-view but the ability to trap basic auth would be quite handy. Im new-ish to rust, but im porting and electron app to rust (more for experience than anything) and its basically a full-screen borderless web interface that's controlled via mqtt.

So far everything works except electron has an ability to handle login popups by passing them back to the underlying JS code and I cant find a way to do that in web-view

This particular code works ok and auth's fine:

```
let mut x = web_view::builder()
...
x.eval("window.location.href = 'https://guest:guest@jigsaw.w3.org/HTTP/Basic/';");

```

But I cant seem to find any way to know if the endpoint wanted auth in the first place which makes it a little tricky.

The other problem is that when the endpoint does request a login dialog, I get a popup in the webview window and can no longer control the webview window from within rust until something closes that dialog. Calling x.terminate()/exit() will eventually close the window though.

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names web_view::builder, x.eval(...), and x.terminate()/exit(); begin by tracing how these APIs handle authentication and modal popups across the webview backends. Define how Basic Auth requests and login dialogs should be surfaced to Rust or JavaScript, then verify behavior with the reported Basic Auth URL and popup case.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, rust
Domain
desktop, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.