netsurf/javascript/duktape/Navigator.bnd

88 lines
1.4 KiB
Plaintext
Raw Normal View History

2015-10-05 17:46:22 +03:00
/* 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
*/
2015-10-09 14:54:00 +03:00
prologue Navigator()
%{
#include "utils/useragent.h"
%}
2015-10-05 17:46:22 +03:00
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;
%}
2015-10-09 14:54:00 +03:00
getter Navigator::userAgent()
%{
duk_push_string(ctx, user_agent_string());
return 1;
%}