mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Expose user agent option to DOM navigator interface.
This commit is contained in:
parent
6317905342
commit
eb5532c781
6 changed files with 38 additions and 12 deletions
|
@ -3,6 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use servo_util::str::DOMString;
|
||||
use servo_util::opts;
|
||||
|
||||
pub struct NavigatorInfo;
|
||||
|
||||
|
@ -26,4 +27,11 @@ impl NavigatorInfo {
|
|||
pub fn Platform() -> DOMString {
|
||||
"".to_string()
|
||||
}
|
||||
|
||||
pub fn UserAgent() -> DOMString {
|
||||
match opts::get().user_agent {
|
||||
Some(ref user_agent) => user_agent.clone(),
|
||||
None => "".to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue