mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
Removing the userAgent setting from the platform module
This commit is contained in:
@ -18,7 +18,6 @@ export class device implements definition.device {
|
||||
private static _sdkVersion: string;
|
||||
private static _deviceType: string;
|
||||
private static _uuid: string;
|
||||
private static _userAgent: string;
|
||||
private static _language: string;
|
||||
|
||||
static get os(): string {
|
||||
@ -84,15 +83,6 @@ export class device implements definition.device {
|
||||
return device._uuid;
|
||||
}
|
||||
|
||||
static get userAgent(): string {
|
||||
if (!device._userAgent) {
|
||||
var context = application.android.context;
|
||||
device._userAgent = new android.webkit.WebView(context).getSettings().getUserAgentString();
|
||||
}
|
||||
|
||||
return device._userAgent;
|
||||
}
|
||||
|
||||
static get language(): string {
|
||||
if (!device._language) {
|
||||
var context = application.android.context;
|
||||
|
6
platform/platform.d.ts
vendored
6
platform/platform.d.ts
vendored
@ -57,12 +57,6 @@ declare module "platform" {
|
||||
*/
|
||||
static uuid: string;
|
||||
|
||||
/**
|
||||
* Gets the user agent string as it would be reported by the
|
||||
* device built-in web browser control
|
||||
*/
|
||||
static userAgent: string;
|
||||
|
||||
/**
|
||||
* Gets the preferred language. For example "en" or "en_US"
|
||||
*/
|
||||
|
@ -14,7 +14,6 @@ export class device implements definition.device {
|
||||
private static _osVersion: string;
|
||||
private static _sdkVersion: string;
|
||||
private static _deviceType: string;
|
||||
private static _userAgent: string;
|
||||
private static _language: string;
|
||||
|
||||
static get manufacturer(): string {
|
||||
@ -77,14 +76,6 @@ export class device implements definition.device {
|
||||
return app_uuid;
|
||||
}
|
||||
|
||||
static get userAgent(): string {
|
||||
if (!device._userAgent) {
|
||||
device._userAgent = new UIWebView().stringByEvaluatingJavaScriptFromString('navigator.userAgent');
|
||||
}
|
||||
|
||||
return device._userAgent;
|
||||
}
|
||||
|
||||
static get language(): string {
|
||||
if (!device._language) {
|
||||
var languages = NSLocale.preferredLanguages();
|
||||
|
Reference in New Issue
Block a user