4655 userStyle += ( |
4655 userStyle += ( |
4656 WebBrowserTools.readAllFileContents(styleSheetFile) |
4656 WebBrowserTools.readAllFileContents(styleSheetFile) |
4657 .replace("\n", "") |
4657 .replace("\n", "") |
4658 ) |
4658 ) |
4659 |
4659 |
4660 oldScript = self.webProfile().scripts().findScript(name) |
4660 scripts = self.webProfile().scripts().find(name) |
4661 if not oldScript.isNull(): |
4661 if scripts: |
4662 self.webProfile().scripts().remove(oldScript) |
4662 self.webProfile().scripts().remove(scripts[0]) |
4663 |
4663 |
4664 if userStyle: |
4664 if userStyle: |
4665 from .WebBrowserPage import WebBrowserPage |
4665 from .WebBrowserPage import WebBrowserPage |
4666 |
4666 |
4667 script = QWebEngineScript() |
4667 script = QWebEngineScript() |
4728 ################################### |
4728 ################################### |
4729 ## Support for download files below |
4729 ## Support for download files below |
4730 ################################### |
4730 ################################### |
4731 |
4731 |
4732 @classmethod |
4732 @classmethod |
4733 def downloadRequested(cls, download): |
4733 def downloadRequested(cls, downloadRequest): |
4734 """ |
4734 """ |
4735 Class method to handle a download request. |
4735 Class method to handle a download request. |
4736 |
4736 |
4737 @param download reference to the download data |
4737 @param downloadRequest reference to the download data |
4738 @type QWebEngineDownloadItem |
4738 @type QWebEngineDownloadRequest |
4739 """ |
4739 """ |
4740 cls.downloadManager().download(download) |
4740 cls.downloadManager().download(downloadRequest) |
4741 |
4741 |
4742 ######################################## |
4742 ######################################## |
4743 ## Support for web engine profiles below |
4743 ## Support for web engine profiles below |
4744 ######################################## |
4744 ######################################## |
4745 |
4745 |