IAdblockPlusSubscription
General notes
This interface represents a group in the Adblock Plus preferences dialog, it is returned by IAdblockPlus. All access is read-only.
Note: You should not keep a reference to this object. If you need the state of the same subscription at a later point in time you should request it again from IAdblockPlus to get correct information.
Methods and properties
- readonly boolean autoDownload
- readonly boolean disabled
- readonly AString downloadStatus
- readonly boolean external
- void getPatterns ( out unsigned long length, retval arrayof wstring patterns )
- readonly long lastDownload
- readonly AString lastModified
- readonly boolean special
- readonly AUTF8String title
- readonly AString url
![]()
readonly AString url
Subscription identifier. This can be any string for externally managed subscriptions and special groups, for other subscriptions this will be their update URL.
![]()
readonly boolean special
Defines whether the subscription is a special group containing user filters. Currently there are four special groups, namely fl (normal filters), wl (exception rules), eh (element hiding rules) and il (invalid rules).
![]()
readonly AString title
Subscription’s title as displayed in the Preferences dialog
![]()
readonly boolean autoDownload
Defines whether the subscription will be updated automatically. Note that this attribute is meaningless for externally managed subscriptions and special groups.
![]()
readonly boolean disabled
Defines whether the subscription is disabled. If this attribute is set to true the filters in the subscription won’t be applied.
![]()
readonly boolean external
Defines whether the subscription is managed externally. If this attribute is set to true the filters in the subscription will only be updated if some extension calls IAdblockPlus.updateExternalSubscription.
![]()
readonly long lastDownload
Timestamp (return value of new Date().getTime()) of last attempt to download the subscription. The value 0 means that the subscription was never downloaded.
![]()
readonly AString downloadStatus
Result code for the last download attempt. This can have the following values:
- ok — Success
- invalid_url — Subscription URL is invalid
- connection_error — Subscription could not be downloaded
- invalid_data — Subscription was downloaded but the first line wasn’t [Adblock]
![]()
readonly AString lastModified
Value of the Last-Modified HTTP header received with the last successful download. This isn’t used yet and will always be empty.
![]()
void getPatterns ( out unsigned long length, retval arrayof wstring patterns )
Retrieves the list of filter rules for a subscription. Note that this method usually will not return anything useful for special groups.
- Arguments:
- length: variable to hold the length of returned array
- Returns:
- array with subscription’s filter rules
When called from JavaScript the value of parameter length isn’t required as the length can be obtained from the array itself. The call then looks like this:
var patterns = subscription.getPatterns({});
