Namespace: Proxify

Cocoon. Proxify

Proxies different functions of the WebView environment, like Audio objects and XHR.

Methods

<static> audio()

Proxifies the Audio type for the environment where this call is made. After calling this function, all the new objects of Audio that are instantiated, will be proxified objects that will make calls to the counterparts in the other environment (Cocoon <-> WebView viceversa). IMPORTANT NOTE: Remember to take down the proxification once you are done or to delete proxy objects whenever they are not needed anymore or memory leaks may occur.

Example
Cocoon.Proxify.audio();

<static> console()

This function allows to forward console messages from the WebView to the CocoonJS debug console. What it does is to change the console object for a new one with all it's methods (log, error, info, debug and warn) forwarding their messages to the Cocoon environment. The original console object is stored in the Cocoon.originalConsole property.

Example
Cocoon.Proxify.console();

<static> deproxifyConsole()

This function restores the original console object and removes the proxified console object.

Example
Cocoon.Proxify.deproxifyConsole();

<static> xhr()

Proxifies the XMLHttpRequest type for the environment where this call is made. After calling this function, all the new objects of XMLHttpRequest that are instantiated, will be proxified objects that will make calls to the counterparts in the other environment (Cocoon <-> WebView viceversa). IMPORTANT NOTE: Remember to take down the proxification once you are done or to delete proxy objects whenever they are not needed anymore or memory leaks may occur.

Example
Cocoon.Proxify.xhr();
Cocoon Canvas+ - JavaScript Documentation by Ludei, DocStrap Copyright © 2012-2013
The contributors to the JSDoc3 and DocStrap projects.