mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Disabled tinyfiledialogs when running headless.
This commit is contained in:
parent
e1841fbd36
commit
f05577cb29
6 changed files with 21 additions and 2 deletions
|
@ -17,6 +17,7 @@ use dom_struct::dom_struct;
|
|||
use js::conversions::ConversionResult;
|
||||
use js::jsapi::{JSContext, JSObject};
|
||||
use js::jsval::{ObjectValue, UndefinedValue};
|
||||
use servo_config::opts;
|
||||
use servo_config::prefs::PREFS;
|
||||
use std::rc::Rc;
|
||||
#[cfg(target_os = "linux")]
|
||||
|
@ -308,6 +309,9 @@ pub fn get_descriptor_permission_state(permission_name: PermissionName,
|
|||
|
||||
#[cfg(target_os = "linux")]
|
||||
fn prompt_user(message: &str) -> PermissionState {
|
||||
if opts::get().headless {
|
||||
return PermissionState::Denied;
|
||||
}
|
||||
match tinyfiledialogs::message_box_yes_no(DIALOG_TITLE,
|
||||
message,
|
||||
MessageBoxIcon::Question,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue