eric6.WebBrowser.AdBlock.AdBlockManager

Module implementing the AdBlock manager.

Global Attributes

None

Classes

AdBlockManager Class implementing the AdBlock manager.

Functions

None


AdBlockManager

Class implementing the AdBlock manager.

Signals

rulesChanged()
emitted after some rule has changed

Derived from

QObject

Class Attributes

None

Class Methods

None

Methods

AdBlockManager Constructor
__canRunOnScheme Private method to check, if AdBlock can be performed on the scheme.
__customSubscriptionLocation Private method to generate the path for custom subscriptions.
__customSubscriptionUrl Private method to generate the URL for custom subscriptions.
__loadSubscriptions Private method to load the set of subscriptions.
__rulesChanged Private slot handling a change of the AdBlock rules.
addException Public method to add an exception.
addSubscription Public method to add an AdBlock subscription.
addSubscriptionFromUrl Public method to ad an AdBlock subscription given the abp URL.
block Public method to check, if a request should be blocked.
close Public method to close the open search engines manager.
customRules Public method to get a subscription for custom rules.
elementHidingRules Public method to get the element hiding rules.
elementHidingRulesForDomain Public method to get the element hiding rules for a domain.
exceptions Public method to get a list of excepted hosts.
getDefaultSubscriptionUrl Public method to get the default subscription URL.
getRequiresSubscriptions Public method to get a list of subscriptions, that require the given one.
isEnabled Public method to check, if blocking ads is enabled.
isHostExcepted Public slot to check, if a host is excepted.
load Public method to load the AdBlock subscriptions.
loadRequiredSubscription Public method to load a subscription required by another one.
page Public method to get a reference to the page block object.
removeException Public method to remove an exception.
removeSubscription Public method to remove an AdBlock subscription.
save Public method to save the AdBlock subscriptions.
setEnabled Public slot to set the enabled state.
setExceptions Public method to set the list of excepted hosts.
setUseLimitedEasyList Public method to set the limited EasyList flag.
showDialog Public slot to show the AdBlock subscription management dialog.
showExceptionsDialog Public method to show the AdBlock Exceptions dialog.
subscription Public method to get a subscription based on its location.
subscriptions Public method to get all subscriptions.
updateAllSubscriptions Public method to update all subscriptions.
useLimitedEasyList Public method to test, if limited EasyList rules shall be used.

Static Methods

None

AdBlockManager (Constructor)

AdBlockManager(parent=None)

Constructor

parent
reference to the parent object (QObject)

AdBlockManager.__canRunOnScheme

__canRunOnScheme(scheme)

Private method to check, if AdBlock can be performed on the scheme.

scheme
scheme to check (string)
Returns:
flag indicating, that AdBlock can be performed (boolean)

AdBlockManager.__customSubscriptionLocation

__customSubscriptionLocation()

Private method to generate the path for custom subscriptions.

Returns:
URL for custom subscriptions (QUrl)

AdBlockManager.__customSubscriptionUrl

__customSubscriptionUrl()

Private method to generate the URL for custom subscriptions.

Returns:
URL for custom subscriptions (QUrl)

AdBlockManager.__loadSubscriptions

__loadSubscriptions()

Private method to load the set of subscriptions.

AdBlockManager.__rulesChanged

__rulesChanged()

Private slot handling a change of the AdBlock rules.

AdBlockManager.addException

addException(host)

Public method to add an exception.

host
to be excepted (string)

AdBlockManager.addSubscription

addSubscription(subscription)

Public method to add an AdBlock subscription.

subscription
AdBlock subscription to be added (AdBlockSubscription)

AdBlockManager.addSubscriptionFromUrl

addSubscriptionFromUrl(url)

Public method to ad an AdBlock subscription given the abp URL.

url (QUrl)
URL to subscribe an AdBlock subscription
Returns:
flag indicating success
Return Type:
bool

AdBlockManager.block

block(info)

Public method to check, if a request should be blocked.

info (QWebEngineUrlRequestInfo)
request info aobject
Returns:
flag indicating to block the request
Return Type:
bool

AdBlockManager.close

close()

Public method to close the open search engines manager.

AdBlockManager.customRules

customRules()

Public method to get a subscription for custom rules.

Returns:
subscription object for custom rules (AdBlockSubscription)

AdBlockManager.elementHidingRules

elementHidingRules(url)

Public method to get the element hiding rules.

url
URL to get hiding rules for (QUrl)
Returns:
element hiding rules (string)

AdBlockManager.elementHidingRulesForDomain

elementHidingRulesForDomain(url)

Public method to get the element hiding rules for a domain.

url
URL to get hiding rules for (QUrl)
Returns:
element hiding rules (string)

AdBlockManager.exceptions

exceptions()

Public method to get a list of excepted hosts.

Returns:
list of excepted hosts (list of string)

AdBlockManager.getDefaultSubscriptionUrl

getDefaultSubscriptionUrl()

Public method to get the default subscription URL.

Returns:
default subscription URL
Return Type:
str

AdBlockManager.getRequiresSubscriptions

getRequiresSubscriptions(subscription)

Public method to get a list of subscriptions, that require the given one.

subscription
subscription to check for (AdBlockSubscription)
Returns:
list of subscription requiring the given one (list of AdBlockSubscription)

AdBlockManager.isEnabled

isEnabled()

Public method to check, if blocking ads is enabled.

Returns:
flag indicating the enabled state (boolean)

AdBlockManager.isHostExcepted

isHostExcepted(host)

Public slot to check, if a host is excepted.

host
host to check (string)
Returns:
flag indicating an exception (boolean)

AdBlockManager.load

load()

Public method to load the AdBlock subscriptions.

AdBlockManager.loadRequiredSubscription

loadRequiredSubscription(location, title)

Public method to load a subscription required by another one.

location
location of the required subscription (string)
title
title of the required subscription (string)

AdBlockManager.page

page()

Public method to get a reference to the page block object.

Returns:
reference to the page block object (AdBlockPage)

AdBlockManager.removeException

removeException(host)

Public method to remove an exception.

host
to be removed from the list of exceptions (string)

AdBlockManager.removeSubscription

removeSubscription(subscription, emitSignal=True)

Public method to remove an AdBlock subscription.

subscription
AdBlock subscription to be removed (AdBlockSubscription)
emitSignal
flag indicating to send a signal (boolean)

AdBlockManager.save

save()

Public method to save the AdBlock subscriptions.

AdBlockManager.setEnabled

setEnabled(enabled)

Public slot to set the enabled state.

enabled
flag indicating the enabled state (boolean)

AdBlockManager.setExceptions

setExceptions(hosts)

Public method to set the list of excepted hosts.

hosts
list of excepted hosts (list of string)

AdBlockManager.setUseLimitedEasyList

setUseLimitedEasyList(limited)

Public method to set the limited EasyList flag.

limited (bool)
flag indicating to use limited EasyList

AdBlockManager.showDialog

showDialog()

Public slot to show the AdBlock subscription management dialog.

Returns:
reference to the dialog (AdBlockDialog)

AdBlockManager.showExceptionsDialog

showExceptionsDialog()

Public method to show the AdBlock Exceptions dialog.

Returns:
reference to the exceptions dialog (AdBlockExceptionsDialog)

AdBlockManager.subscription

subscription(location)

Public method to get a subscription based on its location.

location
location of the subscription to search for (string)
Returns:
subscription or None (AdBlockSubscription)

AdBlockManager.subscriptions

subscriptions()

Public method to get all subscriptions.

Returns:
list of subscriptions (list of AdBlockSubscription)

AdBlockManager.updateAllSubscriptions

updateAllSubscriptions()

Public method to update all subscriptions.

AdBlockManager.useLimitedEasyList

useLimitedEasyList()

Public method to test, if limited EasyList rules shall be used.

Returns:
flag indicating limited EasyList rules
Return Type:
bool
Up