You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The embedder should be handling prompts and alerts #19992
match tinyfiledialogs::message_box_yes_no(DIALOG_TITLE,
message,
MessageBoxIcon::Question,
YesNo::No){
YesNo::Yes => PermissionState::Granted,
YesNo::No => PermissionState::Denied,
}
}
#[cfg(not(target_os = "linux"))]
fnprompt_user(_message:&str) -> PermissionState{
// TODO popup only supported on linux
PermissionState::Denied
}
(this needs to communicate with the embedder via the constellation)
I'll file separate issues for the uses in components/bluetooth and components/net, since they need to be solved differently. I'm providing this information so some specific contributors can work on this issue; please check with me first before starting to work on it if I have not discussed it with you.
In the light of #20329, where Script would need to ask the embedder to allow unloading of a document:
I starting looking into it and realized script doesn't have a channel to the embedder yet, and also that script doesn't seem to be aware of it's own top level browsing context.
I assume constellation shouldn't block waiting for the response from the embedder.
In the light of the above, it seems we will have to send a first message from script to constellation, containing a response sender, and then constellation could send a message to the embedder containing the top level browsing context id, and the response sender. The embedder could then directly respond to script via this response sender.
Does this architecture makes sense? Should we instead add a EmbedderProxy directly on script_thread and ask for the top level browsing context id from constellation?
I saw that currently the Alert message also isn't yet forwarded to the embedder, see
I had a quick chat with @cbrewster and we agree that it's fine if the script thread has access to the EmbedderProxy. We could short-circuit the constellation.
Activity
fabricedesre commentedon Feb 17, 2018
How do you see that work? Using an additional method in the embedder and let the embedder send back a message to unblock the script thread execution?
paulrouget commentedon Feb 19, 2018
Yes. See how
allow_navigationworks for example.jdm commentedon Mar 25, 2018
Relevant code:
servo/components/constellation/constellation.rs
Lines 1845 to 1851 in 34f3882
servo/components/script/dom/window.rs
Lines 544 to 550 in 34f3882
servo/components/script/dom/permissions.rs
Lines 311 to 329 in 34f3882
I'll file separate issues for the uses in components/bluetooth and components/net, since they need to be solved differently. I'm providing this information so some specific contributors can work on this issue; please check with me first before starting to work on it if I have not discussed it with you.
jdm commentedon Mar 26, 2018
Filed #20428 and #20429 for the net and bluetooth bits.
gterzian commentedon Apr 8, 2018
In the light of #20329, where Script would need to ask the embedder to allow unloading of a document:
Does this architecture makes sense? Should we instead add a
EmbedderProxydirectly on script_thread and ask for the top level browsing context id from constellation?I saw that currently the
Alertmessage also isn't yet forwarded to the embedder, seeservo/components/constellation/constellation.rs
Line 1757 in 954ac81
So I propose a separate PR to deal with all of this. Sounds good?
paulrouget commentedon Apr 10, 2018
A very similar problem is being addressed here: #20480 and see #20480 (comment)
paulrouget commentedon Apr 10, 2018
I had a quick chat with @cbrewster and we agree that it's fine if the script thread has access to the EmbedderProxy. We could short-circuit the constellation.
Auto merge of #20707 - gterzian:embedder_handling_of_prompts_and_aler…
Auto merge of #20707 - gterzian:embedder_handling_of_prompts_and_aler…
Auto merge of #20707 - gterzian:embedder_handling_of_prompts_and_aler…
Auto merge of #20707 - gterzian:embedder_handling_of_prompts_and_aler…
Auto merge of #20707 - gterzian:embedder_handling_of_prompts_and_aler…
Auto merge of #20707 - gterzian:embedder_handling_of_prompts_and_aler…