fix: add source browsing context to Request and HTTP credentials prompt (#34808)

* fix: add source browsing ctx id to request when initiate navigation

Signed-off-by: Jason Tsai <git@pews.dev>

* chore: clippy

Signed-off-by: Jason Tsai <git@pews.dev>

* Update components/net/http_loader.rs

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Jason Tsai <git@pews.dev>

* chore: apply suggestions

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Jason Tsai <git@pews.dev>

* chore: fix naming

Signed-off-by: Jason Tsai <git@pews.dev>

* refactor: set request browsing ctx id on pre page load

Signed-off-by: Jason Tsai <git@pews.dev>

---------

Signed-off-by: Jason Tsai <git@pews.dev>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Jason Tsai 2025-01-03 14:35:16 +08:00 committed by GitHub
parent b87a0db497
commit 8b115c246c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 28 additions and 7 deletions

View file

@ -3505,6 +3505,7 @@ impl ScriptThread {
/// argument until a notification is received that the fetch is complete.
fn pre_page_load(&self, mut incomplete: InProgressLoad, load_data: LoadData) {
let id = incomplete.pipeline_id;
let top_level_browsing_context_id = incomplete.top_level_browsing_context_id;
let req_init = RequestBuilder::new(load_data.url.clone(), load_data.referrer)
.method(load_data.method)
.destination(Destination::Document)
@ -3512,6 +3513,7 @@ impl ScriptThread {
.credentials_mode(CredentialsMode::Include)
.use_url_credentials(true)
.pipeline_id(Some(id))
.target_browsing_context_id(Some(top_level_browsing_context_id))
.referrer_policy(load_data.referrer_policy)
.headers(load_data.headers)
.body(load_data.data)