Home

# Class goog.net.xpc.NativeMessagingTransport

The native messaging transport Uses document.postMessage() to send messages to other documents. Receiving is done by listening on 'message'-events on the document.

extends goog.net.xpc.Transport

Instance Method Summary
| `connect()` Connects this transport.

`connectWithRetries_()`

Connects to other peer. In the case of the outer peer, the setup messages are likely sent before the inner peer is ready to receive them. Therefore, this function will continue trying to send the SETUP message until the inner peer responds. In the case of the inner peer, it will occasionally have its channel name fall out of sync with the outer peer, particularly during soft-reloads and history navigations.

`disposeInternal()`

Deletes or nulls out any references to COM objects, DOM nodes, or other disposable objects. Classes that extend {@code goog.Disposable} should override this method. Not reentrant. To avoid calling it twice, it must only be called from the subclass' {@code disposeInternal} method. Everywhere else the public {@code dispose} method must be used. For example:

    mypackage.MyClass = function() {
    goog.base(this);
    // Constructor logic specific to MyClass.
    ...
    };
    goog.inherits(mypackage.MyClass, goog.Disposable);

    mypackage.MyClass.prototype.disposeInternal = function() {
    goog.base(this, 'disposeInternal');
    // Dispose logic specific to MyClass.
    ...
    };

| `send(string service, string payload)` Sends a message.
| `transportServiceHandler(string payload)` Handles transport service messages.

Static Method Summary
| `initialize_(?Window listenWindow)` Initializes this transport. Registers a listener for 'message'-events on the document.
| `messageReceived_(?goog.events.BrowserEvent msgEvt) ⇒ boolean` Processes an incoming message-event.