Repository navigation
Conversation
The sign-in window is a bare webview, so users type their Google password without seeing where they are. A browser would show the address, and that is what lets people notice a lookalike phishing page. The window now holds two webviews: a read-only address bar on top and Google's page below it. The bar is a local page with no IPC access, and only Rust writes to it, on every page load, so the page being shown cannot fake it. This needs Tauri's `unstable` feature, which is the one that allows more than one webview per window. On Linux, Tauri packs child webviews into the window's GTK box, which ignores their bounds and splits the height evenly, so there the bar is pinned to its own height through GTK. That adds the `gtk` crate, which is already in the tree through Tauri. Other platforms lay the two out again on resize. cancelSignIn now looks the window up with Window.getByLabel, since no webview carries the window's own label any more.
|
@zebus3d is attempting to deploy a commit to the Faizan Asad's projects Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
The YouTube Music sign-in window is a bare webview, so users type their Google password without seeing where they are. A browser would show the address, and that is what lets people notice a lookalike phishing page.
The sign-in window now shows a read-only address bar above Google's page, like a browser:
login-bar.html, a tiny local page) on top and the Google page below it.on_page_loadcallseval("window.showUrl(...)")on the bar with the real URL, JSON-encoded. The page being shown cannot reach the bar, so it cannot fake it.loadedflag the silent refresh relies on.Webviewand close its window, andcancelSignInlooks the window up withWindow.getByLabel, since no webview carries the window's own label any more.More than one webview per window needs Tauri's
unstablefeature. On Linux, Tauri packs child webviews into the window's GTK box, which ignores bounds and splits the height evenly, so there the bar is pinned to its own height through GTK. That adds thegtkcrate, which is already in the dependency tree through Tauri. On other platforms the two webviews are laid out again on resize.How it was checked
npm run verifypassescargo testpasseshttps://accounts.google.com/…, follows navigation, and keeps its height when the window is resized.Notes for the reviewer
set_boundson resize; please give it a quick look there before merging.unstablefeature, a new page invite.config.ts, agtkdependency on Linux), so it is kept separate from the rest. Feel free to decline it if that trade-off is not worth it for you.pushState, without a navigation, do not fireon_page_load. The host shown is still right in that case, which is the part that matters for spotting a phishing page.