├── CONTRIBUTING.md ├── LICENSE.md ├── README.md └── index.html /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Browser Extension Community Group 2 | 3 | This repository is being used for work in the W3C Browser Extension Community Group, governed by the [W3C Community License Agreement (CLA)](http://www.w3.org/community/about/agreements/cla/). To make substantive contributions, you must join the CG. 4 | 5 | If you are not the sole contributor to a contribution (pull request), please identify all 6 | contributors in the pull request comment. 7 | 8 | To add a contributor (other than yourself, that's automatic), mark them one per line as follows: 9 | 10 | ``` 11 | +@github_username 12 | ``` 13 | 14 | If you added a contributor by mistake, you can remove them in a comment with: 15 | 16 | ``` 17 | -@github_username 18 | ``` 19 | 20 | If you are making a pull request on behalf of someone else but you had no part in designing the 21 | feature, you can remove yourself with the above syntax. 22 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | All Reports in this Repository are licensed by Contributors 2 | under the 3 | [W3C Software and Document License](http://www.w3.org/Consortium/Legal/2015/copyright-software-and-document). 4 | Contributions to Specifications are made under the 5 | [W3C CLA](https://www.w3.org/community/about/agreements/cla/). 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # The Native Messaging for Browser Extensions Specification 2 | 3 | ⚠ 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. 4 | 5 | The specifications have therefore not been maintained in a while, and are out of date. 6 | 7 | In the meanwhile, a new [“WebExtensions Community Group”](https://github.com/w3c/webextensions), with similar objectives but much more active participation, has sprung up. People interested in this topic are encouraged to join that group. 8 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Native Messaging for Browser Extensions 5 | 6 | 7 | 42 | 43 | 44 |
45 |

46 | Various applications of Browser Extensions 47 | need a mechanism to communicate with local client native processes outside of the browser environment. 48 | This specification proposes such a mechanism. 49 |

50 |
51 |
52 |

53 | This specification is not actively maintained. 54 | Issues previously filed against it can be read on 55 | github. 56 | A public archived mailing list 57 | was also available, 58 | but was reserved for high level discussions, 59 | and was not appropriate for specific comments about this document. 60 |

61 | 62 |

63 | Work on this document is governed by 64 | the charter of the Browser Extension CG, 65 | which includes among other things the Communication, 66 | Decision, 67 | and Contribution policies 68 | of this community group. 69 |

70 | 71 |
72 |

73 | Implementation of the technologies discussed and tentatively specified in this Community Group is ongoing 74 | and none of the original contributors have expressed opposition to this work. 75 | However, due to various circumstances, 76 | the level of participation has dropped below the level at which productive discussion is possible, 77 | and activity in this group has stopped as a result. 78 |

79 | 80 |

81 | The specifications have therefore not been maintained in a while, and are out of date. 82 |

83 | 84 |

85 | In the meanwhile, a new “WebExtensions Community Group”, 86 | with similar objectives but much more active participation, 87 | has sprung up. 88 | People interested in this topic are encouraged to join that group. 89 |

90 |
91 |
92 | 93 |
94 |

Introduction

95 |

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.

96 |

This specification defines the interfaces and behavior which enables extensions to communicate with local client native processes outside of the browser environment.

97 |

It is not a goal of this specification to define:

98 | 103 |
104 | 105 |
106 |

Core APIs

107 |

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.

108 |
109 |

The runtime object

110 |
111 |

Overview

112 |

113 | In addition to the base functionality of the browser.runtime object defined in the [[!browserext]] Browser Extensions specification, these additional APIs provide functionaly for Native Messaging. 114 |

115 |
116 |

Manifest

117 |

118 | The "nativeMessaging" permission is required to use these additional APIs. 119 |

120 |
121 | {
122 |     "permissions": [                               // Required
123 |         "nativeMessaging"                          // Required
124 |     ]                                              // Required   
125 | }
126 | 
127 |
128 |
129 |

Context

130 |

131 | This API is available only in background pages, a subset of the Window context. 132 |

133 |
134 |
135 |

WebIDL Definition

136 |

137 | A description of the special WebIDL syntax considerations for browser extensions are defined elsewhere in the [[!browserext]] Browser Extensions specification. 138 |

139 |
140 | dictionary BrowserExtRuntimePort {
141 |     Function disconnect;
142 |     DOMString name;
143 |     object onDisconnect;
144 |     object onMessage;
145 |     Function postMessage;
146 |     MessageSender sender;
147 | };
148 | callback BrowserExtRuntimeSendNativeMessageCallback = void (any response);
149 | [NoInterfaceObject]
150 | partial interface BrowserExtBrowserRuntimeNativeMessaging {
151 |     BrowserExtRuntimePort connectNative(DOMString nativeServiceName);
152 |     void sendNativeMessage(DOMString nativeServiceName, object message, optional RuntimeSendNativeMessageCallback callback);
153 |     attribute BrowserExtRuntimePort Port;
154 | };
155 | [NoInterfaceObject, Exposed=Window,Ck_Any_Prm_nativeMessaging_]
156 | interface BrowserExtRuntimeNativeMessagingAPI {
157 |     readonly attribute BrowserExtRuntimeNativeMessaging runtime; 
158 | };
159 | Browser implements BrowserExtRuntimeNativeMessagingAPI;
160 | 
161 | 
162 |
163 |
164 |
165 | 166 |
167 |

Local Client Native Process Registration

168 |

The local client native process must register itself in such a way that the browser will be able to:

169 | 174 |

Each browser implementation may have different mechanisms for registration, message filtering and lifetime management of the local client native process.

175 |
176 | 196 | 197 | 198 | --------------------------------------------------------------------------------