1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
/* Navigator binding for browser using duktape and libdom
*
* Copyright 2015 Vincent Sanders <vince@netsurf-browser.org>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
* Released under the terms of the MIT License,
* http://www.opensource.org/licenses/mit-license
*/
prologue Navigator()
%{
#include "utils/useragent.h"
%}
method Navigator::taintEnabled()
%{
duk_push_boolean(ctx, false);
return 1;
%}
getter Navigator::appCodeName()
%{
duk_push_string(ctx, "Mozilla");
return 1;
%}
getter Navigator::appName()
%{
duk_push_string(ctx, "Netscape");
return 1;
%}
getter Navigator::appVersion()
%{
duk_push_string(ctx, "3.4");
return 1;
%}
getter Navigator::platform()
%{
duk_push_string(ctx, NULL);
return 1;
%}
getter Navigator::product()
%{
duk_push_string(ctx, "Gecko");
return 1;
%}
getter Navigator::productSub()
%{
duk_push_string(ctx, "20100101");
return 1;
%}
getter Navigator::vendor()
%{
duk_push_string(ctx, NULL);
return 1;
%}
getter Navigator::vendorSub()
%{
duk_push_string(ctx, NULL);
return 1;
%}
getter Navigator::cookieEnabled()
%{
duk_push_boolean(ctx, false);
return 1;
%}
/* indicate there is no plugin for java installed */
getter Navigator::javaEnabled()
%{
duk_push_boolean(ctx, false);
return 1;
%}
getter Navigator::userAgent()
%{
duk_push_string(ctx, user_agent_string());
return 1;
%}
|