My favorites | Sign in
Project Logo
                
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
88
89
90
91
92
93
94
95
96
97
98
99
/*
The MIT License

Copyright (c) 2008 jacob berkman <jacob@ilovegom.org>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
var xgNavigatorModule = { };
function NSGetModule (aCompMgr, aFileSpec) { return xgNavigatorModule; }

(function () {

const Cc = Components.classes;
const Ci = Components.interfaces;

const CLASS_ID = Components.ID('{A09E6353-FE78-4C69-AD70-0E5CC59345E3}');
const CLASS_NAME = 'An Navigator object for Gom';
const CONTRACT_ID = '@ilovegom.org/navigator;1';

function xgNavigator() {
this.wrappedJSObject = this;
};

xgNavigator.prototype = {
// nsIDOMNavigator
appCodeName: 'Mozilla',
appName: 'Gom',
appVersion: '@VERSION@',
cookieEnabled: false,
language: 'en',
mimeTypes: null,
platform: '@host_os@',
userAgent: 'Mozilla/5.0 (compatible; Gom/@VERSION@; @host_os@)',

javaEnabled: function () { return false; },
taintEnabled: function () { return false; },

// nsISupports
QueryInterface: function (aIID) {
if (!aIID.equals(Ci.nsIDOMNavigator) &&
!aIID.equals(Ci.nsISupports))
throw Components.results.NS_ERROR_NO_INTERFACE;
return this;
}
};

var xgNavigatorFactory = {
createInstance: function (aOuter, aIID) {
if (aOuter != null) {
throw Components.results.NS_ERROR_NO_AGGREGATION;
}
return (new xgNavigator).QueryInterface (aIID);
}
};

xgNavigatorModule.registerSelf = function(aCompMgr, aFileSpec, aLocation, aType)
{
aCompMgr = aCompMgr.QueryInterface (Components.interfaces.nsIComponentRegistrar);
aCompMgr.registerFactoryLocation (CLASS_ID, CLASS_NAME, CONTRACT_ID,
aFileSpec, aLocation, aType);
};

xgNavigatorModule.unregisterSelf = function (aCompMgr, aLocation, aType)
{
aCompMgr = aCompMgr.QueryInterface (Components.interfaces.nsIComponentRegistrar);
aCompMgr.unregisterFactoryLocation(CLASS_ID, aLocation);
};

xgNavigatorModule.getClassObject = function(aCompMgr, aCID, aIID)
{
if (!aIID.equals(Ci.nsIFactory)) {
throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
}
if (aCID.equals(CLASS_ID)) {
return xgNavigatorFactory;
}

throw Components.results.NS_ERROR_NO_INTERFACE;
};

xgNavigatorModule.canUnload = function (aCompMgr) { return true; }

})();
Show details Hide details

Change log

r76 by ja...@87k.net on Aug 16, 2008   Diff
2008-08-16  jacob berkman
<jacob@ilovegom.org>

        * src/xpgom/xgGomModule.cc: update
for xgWindow

        * src/xpgom/xgNavigator.js.in: an
implementation of
        nsIDOMNavigator

        * src/xpgom/xgParser.js: rename
xgGomParser.js
...
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 3209 bytes, 99 lines
Hosted by Google Code