Helpviewer/AdBlock/AdBlockRule.py

changeset 5383
4bf49e0840f3
parent 4631
5c1a96925da4
child 5389
9b1c800daff3
equal deleted inserted replaced
5382:5b772524f302 5383:4bf49e0840f3
363 Public slot to match a third-party rule. 363 Public slot to match a third-party rule.
364 364
365 @param req request object to check (QNetworkRequest) 365 @param req request object to check (QNetworkRequest)
366 @return flag indicating a match (boolean) 366 @return flag indicating a match (boolean)
367 """ 367 """
368 referer = bytes(req.attribute(QNetworkRequest.User + 200, "")).decode() 368 referer = \
369 bytes(req.attribute(QNetworkRequest.User + 200, b"")).decode()
369 if referer == "": 370 if referer == "":
370 return False 371 return False
371 372
372 # Third-party matching should be performed on second-level domains 373 # Third-party matching should be performed on second-level domains
373 refererHost = toSecondLevelDomain(QUrl(referer)) 374 refererHost = toSecondLevelDomain(QUrl(referer))

eric ide

mercurial