// create the 'example' global object if it doesn't already exist.
if (!example)
example = {};
// create the 'example.test' global object if it doesn't already exist.
if (!example.test)
example.test = {};
(function() {
// Define the function 'example.test.myfunction'.
example.test.myfunction = function() {
// Call CefV8Handler::Execute() with the function name 'MyFunction'
// and no arguments.
native function MyFunction();
return MyFunction();
};
// Define the getter function for parameter 'example.test.myparam'.
example.test.__defineGetter__('myparam', function() {
// Call CefV8Handler::Execute() with the function name 'GetMyParam'
// and no arguments.
native function GetMyParam();
return GetMyParam();
});
// Define the setter function for parameter 'example.test.myparam'.
example.test.__defineSetter__('myparam', function(b) {
// Call CefV8Handler::Execute() with the function name 'SetMyParam'
// and a single argument.
native function SetMyParam();
if(b) SetMyParam(b);
});
// Extension definitions can also contain normal JavaScript variables
// and functions.
var myint = 0;
example.test.increment = function() {
myint += 1;
return myint;
};
})();
Example usage in the page:
// Call the function.
example.test.myfunction();
// Set the parameter.
example.test.myparam = value;
// Get the parameter.
value = example.test.myparam;
// Call another function.
example.test.increment();
[scheme]://[username]:[password]@[host]:[port]/[url-path]
Standard scheme URLs must have a host component that is a fully
qualified domain name as defined in Section 3.5 of RFC 1034 [13] and
Section 2.1 of RFC 1123. These URLs will be canonicalized to
"scheme://host/path" in the simplest case and
"scheme://username:password@host:port/path" in the most explicit case. For
example, "scheme:host/path" and "scheme:///host/path" will both be
canonicalized to "scheme://host/path". The origin of a standard scheme URL
is the combination of scheme, host and port (i.e., "scheme://host:port" in
the most explicit case).
For non-standard scheme URLs only the "scheme:" component is parsed and
canonicalized. The remainder of the URL will be passed to the handler as-
is. For example, "scheme:///some%20text" will remain the same. Non-standard
scheme URLs cannot be used as a target for form submission.