ResourceManager1.1

back

Commands

Events

ResourceManager is a tool for monitoring, modifying, and creating network activity.

ID fields

External ID fields

AddHeaderOverrides

Add one or more overrides for HTTP headers. An override can be either adding a new header, overwriting an existing one, or removing it completely (if present).

command AddHeaderOverrides(AddHeaderOverridesArg)
{
}
returns (Default)
{
}
= 5;

ClearCache

Clear cached resources, or as many of the resources as possible. (Resources currently in use will not be cleared).

command ClearCache(Default)
{
}
returns (Default)
{
}
= 9;

ClearHeaderOverrides

Remove all overrides previously added with AddHeaderOverride.

command ClearHeaderOverrides(Default)
{
}
returns (Default)
{
}
= 7;

CreateRequest

Create a HTTP request from scratch. It is possible to let Opera choose some common headers, or control everything by hand.

command CreateRequest(CreateRequestArg)
{
}
returns (ResourceID)
{
}
= 8;

GetResource

Get ResourceData for a certain resource.

This command provides a way to get data from a resource after the request has completed, or in cases where there is no request.

It is possible to get the resource with a different content mode than what has been set by SetResponseMode.

command GetResource(GetResourceArg)
{
}
returns (ResourceData)
{
}
= 1;

GetResourceID

Get the resource ID of a URL that is either in cache, or otherwise in use (for instance currently being loaded).

In some cases the same resource may have multiple IDs, for instance POST form results. Trying to get an ID for resources with multiple IDs will result in an error.

An error will also be returned if the specified URL is not in use. Use CreateRequest to generate a resource ID in this case.

Note that setting the reload policy to NO_CACHE does not exclude the use of this command. Setting the reload policy to NO_CACHE does not prevent resources from entering cache, it merely prevents reloading from it.

Added in version 1.1

command GetResourceID(GetResourceIDArg)
{
}
returns (ResourceID)
{
}
= 21;

RemoveHeaderOverrides

Remove overrides previously added with AddHeaderOverrides.

command RemoveHeaderOverrides(RemoveHeaderOverridesArg)
{
}
returns (Default)
{
}
= 6;

SetReloadPolicy

Choose whether resources should be allowed to load from cache, or whether they should be fully downloaded over the network on each reload.

The default mode is to always load resources fully.

command SetReloadPolicy(SetReloadPolicyArg)
{
}
returns (Default)
{
}
= 2;

SetRequestMode

Choose how (and if) request data should be reported. It's possible to set a filter with different settings based on MIME type.

command SetRequestMode(SetRequestModeArg)
{
}
returns (Default)
{
}
= 4;

SetResponseMode

Choose how (and if) response data should be reported. It's possible to set a filter with different settings based on MIME type.

command SetResponseMode(SetResponseModeArg)
{
}
returns (Default)
{
}
= 3;

OnRequest

Fired when a request is created.

event OnRequest returns (Request)
{
}
= 14;

OnRequestFinished

Fired after the entire request (including payload, if any) has been sent.

event OnRequestFinished returns (RequestFinished)
{
}
= 16;

OnRequestHeader

Fired after the request headers are composed.

event OnRequestHeader returns (RequestHeader)
{
}
= 15;

OnRequestRetry

If pipelining is enabled, a request can sometimes be moved to another connection if the previous connection failed, for some reason.

In these cases, this event will fire to indicate that we are retrying the same request under a new requestID.

event OnRequestRetry returns (RequestRetry)
{
}
= 17;

OnResponse

Fired when data is first received from the server, before any headers are parsed.

event OnResponse returns (Response)
{
}
= 18;

OnResponseFinished

Fired when the entire response (including payload) has been downloaded.

event OnResponseFinished returns (ResponseFinished)
{
}
= 20;

OnResponseHeader

Fired when headers are received and parsed.

event OnResponseHeader returns (ResponseHeader)
{
}
= 19;

OnUrlFinished

Resource was completely loaded or failed.

No request events should happen after this point.

event OnUrlFinished returns (UrlFinished)
{
}
= 11;

OnUrlLoad

A resource was requested by the browser.

Depending on the protocol used it may result in OnRequest/OnResponse events. When resource is loaded OnUrlFinished is sent.

event OnUrlLoad returns (UrlLoad)
{
}
= 10;

OnUrlRedirect

Sent when a URL is redirect to another URL. Contains both the original resource ID and the new resource ID.

event OnUrlRedirect returns (UrlRedirect)
{
}
= 12;

OnUrlUnload

The specified URL and resource ID is no longer in use in the browser. Any references to them should be removed.

Trying to use the resource ID after this event will not work.

event OnUrlUnload returns (UrlUnload)
{
}
= 13;