#NEWLINE# def process( self , request , render_options , operation , data ) : #NEWLINE# #INDENT# filter_names = render_options . get_filters ( adblock_rules = self . rules ) #NEWLINE# if ( filter_names == [ 'none' ] ) : #NEWLINE# #INDENT# return request #NEWLINE# #UNINDENT# if ( not filter_names ) : #NEWLINE# #INDENT# if self . rules . filter_is_known ( 'default' ) : #NEWLINE# #INDENT# filter_names = [ 'default' ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return request #NEWLINE# #UNINDENT# #UNINDENT# url = six . text_type ( request . url ( ) . toString ( ) ) #NEWLINE# browser_url = self . _get_browser_url ( request ) #NEWLINE# domain = ( urlsplit ( browser_url ) . hostname or '' ) #NEWLINE# options = { #NEWLINE# #INDENT# 'domain' : domain , #NEWLINE# #UNINDENT# } #NEWLINE# blocking_filter = self . rules . get_blocking_filter ( filter_names , url , options ) #NEWLINE# if blocking_filter : #NEWLINE# #INDENT# if ( self . verbosity >= 2 ) : #NEWLINE# #INDENT# msg = ( 'Filter %s: dropped %s %s' % ( blocking_filter , render_options . get_uid ( ) , request_repr ( request , operation ) ) ) #NEWLINE# log . msg ( options , system = 'request_middleware' ) #NEWLINE# #UNINDENT# drop_request ( request ) #NEWLINE# #UNINDENT# return request