-
Notifications
You must be signed in to change notification settings - Fork 11
/
index.html
197 lines (184 loc) · 8.22 KB
/
index.html
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<!DOCTYPE html>
<html>
<head>
<title>Native Messaging for Browser Extensions</title>
<meta charset='utf-8'>
<script src='https://www.w3.org/Tools/respec/respec-w3c-common' async class='remove'></script>
<script class='remove'>
var respecConfig = {
shortName: "native-messaging",
edDraftURI:"https://browserext.github.io/native-messaging/",
specStatus: "CG-DRAFT",
editors: [
{
name: "Andrew Swan",
company:"Mozilla"
},
{
name: "Mike Pietraszak",
company: "Microsoft Corporation "
}
],
wg: "Browser Extension Community Group",
wgURI: "https://www.w3.org/community/browserext/",
otherLinks: [{
key: 'Participation',
data: [
{
value: 'GitHub repository',
href: 'https://github.com/browserext/native-messaging/'
},
{
value: 'File a bug / view open issues',
href: 'https://github.com/browserext/native-messaging/issues'
}
]
}],
};
</script>
</head>
<body>
<section id='abstract'>
<p>
Various applications of <a href="///browserext.github.io/browserext/">Browser Extensions</a>
need a mechanism to communicate with local client native processes outside of the browser environment.
This specification proposes such a mechanism.
</p>
</section>
<section id='sotd'>
<p>
This specification is not actively maintained.
Issues previously filed against it can be read on
<a href="https://github.com/browserext/native-messaging/issues/">github</a>.
A <a href="http://lists.w3.org/Archives/Public/public-browserext/">public archived mailing list</a>
was also available,
but was reserved for high level discussions,
and was not appropriate for specific comments about this document.
</p>
<p>
Work on this document is governed by
<a href="http://browserext.github.io/charter/">the charter</a> of the Browser Extension CG,
which includes among other things the <a href="http://browserext.github.io/charter/#communication">Communication</a>,
<a href="http://browserext.github.io/charter/#decision-policy">Decision</a>,
and <a href="http://browserext.github.io/charter/#contribution-mechanics">Contribution</a> policies
of this community group.
</p>
<div class="warning" id="inactive-cg">
<p>
Implementation of the technologies discussed and tentatively specified in this Community Group is ongoing
and none of the original contributors have expressed opposition to this work.
However, due to various circumstances,
the level of participation has dropped below the level at which productive discussion is possible,
and activity in this group has stopped as a result.
</p>
<p>
The specifications have therefore not been maintained in a while, and are out of date.
</p>
<p>
In the meanwhile, a new <a href="https://github.com/w3c/webextensions">“WebExtensions Community Group”</a>,
with similar objectives but much more active participation,
has sprung up.
People interested in this topic are encouraged to join that group.
</p>
</div>
</section>
<section class='informative'>
<h2>Introduction</h2>
<p>The Browser Extensions Community Group's goal is to make browser extension code much more interoperable across browsers by specifying common extension interfaces and well-defined browser behavior. </p>
<p>This specification defines the interfaces and behavior which enables extensions to communicate with local client native processes outside of the browser environment.</p>
<p>It is not a goal of this specification to define:</p>
<ul>
<li>The mechanism a browser would use to communicate with the local client native process (e.g. stdio)</li>
<li>The registration specifics of how a browser would locate the local client native process app, service, or binary executable</li>
<li>The specifics of how a browser would the lifetime of local client native process</li>
</ul>
</section>
<section class='informative'>
<h2>Core APIs</h2>
<p>The goal for these APIs is to provide functionality that extension authors need for message-passing between extensions and local client native process outside of the browser. Methods are provided for both establishing long-lived connection ports and for sending individual "one-shot" messages.</p>
<section>
<h4 id="runtime">The <code>runtime</code> object</h4>
<section class="introductory">
<h4>Overview</h4>
<p>
In addition to the base functionality of the <code>browser.runtime</code> object defined in the [[!browserext]] Browser Extensions specification, these additional APIs provide functionaly for Native Messaging.
</p>
</section><section class="introductory">
<h4>Manifest</h4>
<p>
The <code>"nativeMessaging"</code> permission is required to use these additional APIs.
</p>
<pre>
{
"permissions": [ // Required
"nativeMessaging" // Required
] // Required
}
</pre>
</section>
<section class="introductory">
<h4>Context</h4>
<p>
This API is available only in background pages, a subset of the Window context.
</p>
</section>
<section class="introductory">
<h4>WebIDL Definition</h4>
<p>
A description of the special WebIDL syntax considerations for browser extensions are defined elsewhere in the [[!browserext]] Browser Extensions specification.
</p>
<pre class="def idl">
dictionary BrowserExtRuntimePort {
Function disconnect;
DOMString name;
object onDisconnect;
object onMessage;
Function postMessage;
MessageSender sender;
};
callback BrowserExtRuntimeSendNativeMessageCallback = void (any response);
[NoInterfaceObject]
partial interface BrowserExtBrowserRuntimeNativeMessaging {
BrowserExtRuntimePort connectNative(DOMString nativeServiceName);
void sendNativeMessage(DOMString nativeServiceName, object message, optional RuntimeSendNativeMessageCallback callback);
attribute BrowserExtRuntimePort Port;
};
[NoInterfaceObject, Exposed=Window,Ck_Any_Prm_nativeMessaging_]
interface BrowserExtRuntimeNativeMessagingAPI {
readonly attribute BrowserExtRuntimeNativeMessaging runtime;
};
Browser implements BrowserExtRuntimeNativeMessagingAPI;
</pre>
</section>
</section>
</section>
<section class='informative'>
<h2>Local Client Native Process Registration</h2>
<p>The local client native process must register itself in such a way that the browser will be able to:</p>
<ul>
<li>Locate the associated native component on the local client</li>
<li>Start the local client native process when needed</li>
<li>Filter the sending of messages to the local client native process, only allowing specified extensions to send messages</li>
</ul>
<p>Each browser implementation may have different mechanisms for registration, message filtering and lifetime management of the local client native process.</p>
</section>
<script>
function updateCheckAnyPermissions() {
var checkAnyPermissionsToken = "Ck_Any_Prm_";
var e = document.body.getElementsByTagName("pre");
var n = e.length;
var q1 = -1;
for (var i = 0; i < n; i++) {
var s = e[i].innerHTML;
if (s.indexOf(checkAnyPermissionsToken) >= 0) {
q1 = s.indexOf(checkAnyPermissionsToken) + checkAnyPermissionsToken.length;
q2 = s.indexOf("_", q1);
s = s.substring(0, q2) + '"' + s.substring(q2+1,s.length);
e[i].innerHTML = s.replace(checkAnyPermissionsToken, 'CheckAnyPermissions="');
}
}
}
setTimeout(" updateCheckAnyPermissions()", 2000);
</script>
</body>
</html>