9 |
9 |
10 from __future__ import unicode_literals |
10 from __future__ import unicode_literals |
11 |
11 |
12 import re |
12 import re |
13 |
13 |
14 from PyQt5.QtCore import Qt, QRegExp |
14 from PyQt5.QtCore import qVersion, Qt, QRegExp |
15 from PyQt5.QtWebEngineCore import QWebEngineUrlRequestInfo |
15 from PyQt5.QtWebEngineCore import QWebEngineUrlRequestInfo |
16 |
16 |
17 |
17 |
18 def toSecondLevelDomain(url): |
18 def toSecondLevelDomain(url): |
19 """ |
19 """ |
530 @return flag indicating a match (boolean) |
530 @return flag indicating a match (boolean) |
531 """ |
531 """ |
532 match = ( |
532 match = ( |
533 req.resourceType() == |
533 req.resourceType() == |
534 QWebEngineUrlRequestInfo.ResourceTypeSubResource) |
534 QWebEngineUrlRequestInfo.ResourceTypeSubResource) |
|
535 if qVersion() >= "5.7.0": |
|
536 match = match or ( |
|
537 req.resourceType() == |
|
538 QWebEngineUrlRequestInfo.ResourceTypePluginResource) |
535 |
539 |
536 if self.__objectSubrequestException: |
540 if self.__objectSubrequestException: |
537 return not match |
541 return not match |
538 else: |
542 else: |
539 return match |
543 return match |