10 |
10 |
11 import os |
11 import os |
12 import shutil |
12 import shutil |
13 import sys |
13 import sys |
14 |
14 |
15 from PyQt5.QtCore import pyqtSlot, pyqtSignal, Qt, QByteArray, QSize, QTimer, \ |
15 from PyQt5.QtCore import ( |
16 QUrl, QTextCodec, QProcess, QEvent, QFileInfo |
16 pyqtSlot, pyqtSignal, Qt, QByteArray, QSize, QTimer, QUrl, QTextCodec, |
|
17 QProcess, QEvent, QFileInfo |
|
18 ) |
17 from PyQt5.QtGui import QDesktopServices, QKeySequence, QFont, QFontMetrics |
19 from PyQt5.QtGui import QDesktopServices, QKeySequence, QFont, QFontMetrics |
18 from PyQt5.QtWidgets import QWidget, QVBoxLayout, QSizePolicy, QDockWidget, \ |
20 from PyQt5.QtWidgets import ( |
19 QComboBox, QLabel, QMenu, QLineEdit, QApplication, \ |
21 QWidget, QVBoxLayout, QSizePolicy, QDockWidget, QComboBox, QLabel, QMenu, |
20 QWhatsThis, QDialog, QHBoxLayout, QProgressBar, QInputDialog, QAction |
22 QLineEdit, QApplication, QWhatsThis, QDialog, QHBoxLayout, QProgressBar, |
21 from PyQt5.QtWebEngineWidgets import QWebEngineSettings, QWebEnginePage, \ |
23 QInputDialog, QAction |
22 QWebEngineProfile, QWebEngineScript |
24 ) |
|
25 from PyQt5.QtWebEngineWidgets import ( |
|
26 QWebEngineSettings, QWebEnginePage, QWebEngineProfile, QWebEngineScript |
|
27 ) |
23 try: |
28 try: |
24 from PyQt5.QtHelp import QHelpEngine, QHelpEngineCore, QHelpSearchQuery |
29 from PyQt5.QtHelp import QHelpEngine, QHelpEngineCore, QHelpSearchQuery |
25 QTHELP_AVAILABLE = True |
30 QTHELP_AVAILABLE = True |
26 except ImportError: |
31 except ImportError: |
27 QTHELP_AVAILABLE = False |
32 QTHELP_AVAILABLE = False |
160 self.__shortcutsDialog = None |
165 self.__shortcutsDialog = None |
161 |
166 |
162 self.__eventMouseButtons = Qt.NoButton |
167 self.__eventMouseButtons = Qt.NoButton |
163 self.__eventKeyboardModifiers = Qt.NoModifier |
168 self.__eventKeyboardModifiers = Qt.NoModifier |
164 |
169 |
165 if qVersionTuple() < (5, 11, 0) and \ |
170 if ( |
166 Preferences.getWebBrowser("WebInspectorEnabled"): |
171 qVersionTuple() < (5, 11, 0) and |
167 os.environ["QTWEBENGINE_REMOTE_DEBUGGING"] = \ |
172 Preferences.getWebBrowser("WebInspectorEnabled") |
168 str(Preferences.getWebBrowser("WebInspectorPort")) |
173 ): |
|
174 os.environ["QTWEBENGINE_REMOTE_DEBUGGING"] = str( |
|
175 Preferences.getWebBrowser("WebInspectorPort")) |
169 |
176 |
170 WebBrowserWindow.setUseQtHelp(qthelp or bool(searchWord)) |
177 WebBrowserWindow.setUseQtHelp(qthelp or bool(searchWord)) |
171 |
178 |
172 self.webProfile(private) |
179 self.webProfile(private) |
173 self.networkManager() |
180 self.networkManager() |
285 self.__searchDock.setObjectName("SearchWindow") |
292 self.__searchDock.setObjectName("SearchWindow") |
286 self.__searchDock.setWidget(self.__searchWindow) |
293 self.__searchDock.setWidget(self.__searchWindow) |
287 self.addDockWidget(Qt.LeftDockWidgetArea, self.__searchDock) |
294 self.addDockWidget(Qt.LeftDockWidgetArea, self.__searchDock) |
288 |
295 |
289 # JavaScript Console window |
296 # JavaScript Console window |
290 from .WebBrowserJavaScriptConsole import \ |
297 from .WebBrowserJavaScriptConsole import WebBrowserJavaScriptConsole |
291 WebBrowserJavaScriptConsole |
|
292 self.__javascriptConsole = WebBrowserJavaScriptConsole(self) |
298 self.__javascriptConsole = WebBrowserJavaScriptConsole(self) |
293 self.__javascriptConsoleDock = QDockWidget( |
299 self.__javascriptConsoleDock = QDockWidget( |
294 self.tr("JavaScript Console")) |
300 self.tr("JavaScript Console")) |
295 self.__javascriptConsoleDock.setObjectName("JavascriptConsole") |
301 self.__javascriptConsoleDock.setObjectName("JavascriptConsole") |
296 self.__javascriptConsoleDock.setAllowedAreas( |
302 self.__javascriptConsoleDock.setAllowedAreas( |
342 syncMgr = self.syncManager() |
348 syncMgr = self.syncManager() |
343 syncMgr.syncMessage.connect(self.statusBar().showMessage) |
349 syncMgr.syncMessage.connect(self.statusBar().showMessage) |
344 syncMgr.syncError.connect(self.statusBar().showMessage) |
350 syncMgr.syncError.connect(self.statusBar().showMessage) |
345 |
351 |
346 restoreSessionData = {} |
352 restoreSessionData = {} |
347 if WebBrowserWindow._performingStartup and not home and \ |
353 if ( |
348 not WebBrowserWindow.isPrivate(): |
354 WebBrowserWindow._performingStartup and |
|
355 not home and |
|
356 not WebBrowserWindow.isPrivate() |
|
357 ): |
349 startupBehavior = Preferences.getWebBrowser("StartupBehavior") |
358 startupBehavior = Preferences.getWebBrowser("StartupBehavior") |
350 if not private and startupBehavior in [3, 4]: |
359 if not private and startupBehavior in [3, 4]: |
351 if startupBehavior == 3: |
360 if startupBehavior == 3: |
352 # restore last session |
361 # restore last session |
353 restoreSessionFile = \ |
362 restoreSessionFile = ( |
354 self.sessionManager().lastActiveSessionFile() |
363 self.sessionManager().lastActiveSessionFile() |
|
364 ) |
355 elif startupBehavior == 4: |
365 elif startupBehavior == 4: |
356 # select session |
366 # select session |
357 restoreSessionFile = \ |
367 restoreSessionFile = self.sessionManager().selectSession() |
358 self.sessionManager().selectSession() |
368 sessionData = self.sessionManager().readSessionFromFile( |
359 sessionData = \ |
369 restoreSessionFile) |
360 self.sessionManager().readSessionFromFile( |
|
361 restoreSessionFile) |
|
362 if self.sessionManager().isValidSession(sessionData): |
370 if self.sessionManager().isValidSession(sessionData): |
363 restoreSessionData = sessionData |
371 restoreSessionData = sessionData |
364 restoreSession = True |
372 restoreSession = True |
365 else: |
373 else: |
366 if Preferences.getWebBrowser("StartupBehavior") == 0: |
374 if Preferences.getWebBrowser("StartupBehavior") == 0: |
1857 self, 'webbrowser_virustotal_domain_report') |
1865 self, 'webbrowser_virustotal_domain_report') |
1858 self.virustotalDomainReportAct.triggered.connect( |
1866 self.virustotalDomainReportAct.triggered.connect( |
1859 self.__virusTotalDomainReport) |
1867 self.__virusTotalDomainReport) |
1860 self.__actions.append(self.virustotalDomainReportAct) |
1868 self.__actions.append(self.virustotalDomainReportAct) |
1861 |
1869 |
1862 if not Preferences.getWebBrowser("VirusTotalEnabled") or \ |
1870 if ( |
1863 Preferences.getWebBrowser("VirusTotalServiceKey") == "": |
1871 not Preferences.getWebBrowser("VirusTotalEnabled") or |
|
1872 Preferences.getWebBrowser("VirusTotalServiceKey") == "" |
|
1873 ): |
1864 self.virustotalScanCurrentAct.setEnabled(False) |
1874 self.virustotalScanCurrentAct.setEnabled(False) |
1865 self.virustotalIpReportAct.setEnabled(False) |
1875 self.virustotalIpReportAct.setEnabled(False) |
1866 self.virustotalDomainReportAct.setEnabled(False) |
1876 self.virustotalDomainReportAct.setEnabled(False) |
1867 |
1877 |
1868 self.shortcutsAct = E5Action( |
1878 self.shortcutsAct = E5Action( |
2504 args.append("--settings={0}".format(self.__settingsDir)) |
2514 args.append("--settings={0}".format(self.__settingsDir)) |
2505 args.append("--private") |
2515 args.append("--private") |
2506 if linkName: |
2516 if linkName: |
2507 args.append(linkName) |
2517 args.append(linkName) |
2508 |
2518 |
2509 if not os.path.isfile(applPath) or \ |
2519 if ( |
2510 not QProcess.startDetached(sys.executable, args): |
2520 not os.path.isfile(applPath) or |
|
2521 not QProcess.startDetached(sys.executable, args) |
|
2522 ): |
2511 E5MessageBox.critical( |
2523 E5MessageBox.critical( |
2512 self, |
2524 self, |
2513 self.tr('New Private Window'), |
2525 self.tr('New Private Window'), |
2514 self.tr( |
2526 self.tr( |
2515 '<p>Could not start the process.<br>' |
2527 '<p>Could not start the process.<br>' |
2577 |
2589 |
2578 def __about(self): |
2590 def __about(self): |
2579 """ |
2591 """ |
2580 Private slot to show the about information. |
2592 Private slot to show the about information. |
2581 """ |
2593 """ |
2582 chromeVersion, webengineVersion = \ |
2594 chromeVersion, webengineVersion = ( |
2583 WebBrowserTools.getWebEngineVersions() |
2595 WebBrowserTools.getWebEngineVersions() |
|
2596 ) |
2584 E5MessageBox.about( |
2597 E5MessageBox.about( |
2585 self, |
2598 self, |
2586 self.tr("eric6 Web Browser"), |
2599 self.tr("eric6 Web Browser"), |
2587 self.tr( |
2600 self.tr( |
2588 """<b>eric6 Web Browser - {0}</b>""" |
2601 """<b>eric6 Web Browser - {0}</b>""" |
2799 if not self.__tabWidget.shallShutDown(): |
2812 if not self.__tabWidget.shallShutDown(): |
2800 return False |
2813 return False |
2801 |
2814 |
2802 self.__isClosing = True |
2815 self.__isClosing = True |
2803 |
2816 |
2804 if not WebBrowserWindow._performingShutdown and \ |
2817 if ( |
2805 len(WebBrowserWindow.BrowserWindows) == 1 and \ |
2818 not WebBrowserWindow._performingShutdown and |
2806 not WebBrowserWindow.isPrivate(): |
2819 len(WebBrowserWindow.BrowserWindows) == 1 and |
|
2820 not WebBrowserWindow.isPrivate() |
|
2821 ): |
2807 # shut down the session manager in case the last window is |
2822 # shut down the session manager in case the last window is |
2808 # about to be closed |
2823 # about to be closed |
2809 self.sessionManager().shutdown() |
2824 self.sessionManager().shutdown() |
2810 |
2825 |
2811 self.__bookmarksToolBar.setModel(None) |
2826 self.__bookmarksToolBar.setModel(None) |
2903 @return flag indicating successful shutdown (boolean) |
2920 @return flag indicating successful shutdown (boolean) |
2904 """ |
2921 """ |
2905 if not self.__shallShutDown(): |
2922 if not self.__shallShutDown(): |
2906 return False |
2923 return False |
2907 |
2924 |
2908 if WebBrowserWindow._downloadManager is not None and \ |
2925 if ( |
2909 not self.downloadManager().allowQuit(): |
2926 WebBrowserWindow._downloadManager is not None and |
|
2927 not self.downloadManager().allowQuit() |
|
2928 ): |
2910 return False |
2929 return False |
2911 |
2930 |
2912 WebBrowserWindow._performingShutdown = True |
2931 WebBrowserWindow._performingShutdown = True |
2913 |
2932 |
2914 if not WebBrowserWindow.isPrivate(): |
2933 if not WebBrowserWindow.isPrivate(): |
3249 except AttributeError: |
3268 except AttributeError: |
3250 # not yet supported |
3269 # not yet supported |
3251 pass |
3270 pass |
3252 |
3271 |
3253 self.__virusTotal.preferencesChanged() |
3272 self.__virusTotal.preferencesChanged() |
3254 if not Preferences.getWebBrowser("VirusTotalEnabled") or \ |
3273 if ( |
3255 Preferences.getWebBrowser("VirusTotalServiceKey") == "": |
3274 not Preferences.getWebBrowser("VirusTotalEnabled") or |
|
3275 Preferences.getWebBrowser("VirusTotalServiceKey") == "" |
|
3276 ): |
3256 self.virustotalScanCurrentAct.setEnabled(False) |
3277 self.virustotalScanCurrentAct.setEnabled(False) |
3257 self.virustotalIpReportAct.setEnabled(False) |
3278 self.virustotalIpReportAct.setEnabled(False) |
3258 self.virustotalDomainReportAct.setEnabled(False) |
3279 self.virustotalDomainReportAct.setEnabled(False) |
3259 else: |
3280 else: |
3260 self.virustotalScanCurrentAct.setEnabled(True) |
3281 self.virustotalScanCurrentAct.setEnabled(True) |
3295 |
3316 |
3296 def __showCookiesConfiguration(self): |
3317 def __showCookiesConfiguration(self): |
3297 """ |
3318 """ |
3298 Private slot to configure the cookies handling. |
3319 Private slot to configure the cookies handling. |
3299 """ |
3320 """ |
3300 from .CookieJar.CookiesConfigurationDialog import \ |
3321 from .CookieJar.CookiesConfigurationDialog import ( |
3301 CookiesConfigurationDialog |
3322 CookiesConfigurationDialog |
|
3323 ) |
3302 dlg = CookiesConfigurationDialog(self) |
3324 dlg = CookiesConfigurationDialog(self) |
3303 dlg.exec_() |
3325 dlg.exec_() |
3304 |
3326 |
3305 def __showFlashCookiesManagement(self): |
3327 def __showFlashCookiesManagement(self): |
3306 """ |
3328 """ |
3490 def __manageQtHelpDocumentation(self): |
3512 def __manageQtHelpDocumentation(self): |
3491 """ |
3513 """ |
3492 Private slot to manage the QtHelp documentation database. |
3514 Private slot to manage the QtHelp documentation database. |
3493 """ |
3515 """ |
3494 if WebBrowserWindow._useQtHelp: |
3516 if WebBrowserWindow._useQtHelp: |
3495 from .QtHelp.QtHelpDocumentationDialog import \ |
3517 from .QtHelp.QtHelpDocumentationDialog import ( |
3496 QtHelpDocumentationDialog |
3518 QtHelpDocumentationDialog |
|
3519 ) |
3497 dlg = QtHelpDocumentationDialog(self.__helpEngine, self) |
3520 dlg = QtHelpDocumentationDialog(self.__helpEngine, self) |
3498 dlg.exec_() |
3521 dlg.exec_() |
3499 if dlg.hasDocumentationChanges(): |
3522 if dlg.hasDocumentationChanges(): |
3500 for i in sorted(dlg.getTabsToClose(), reverse=True): |
3523 for i in sorted(dlg.getTabsToClose(), reverse=True): |
3501 self.__tabWidget.closeBrowserAt(i) |
3524 self.__tabWidget.closeBrowserAt(i) |
3549 |
3572 |
3550 def __searchForWord(self): |
3573 def __searchForWord(self): |
3551 """ |
3574 """ |
3552 Private slot to search for a word. |
3575 Private slot to search for a word. |
3553 """ |
3576 """ |
3554 if WebBrowserWindow._useQtHelp and not self.__indexing and \ |
3577 if ( |
3555 self.__searchWord is not None: |
3578 WebBrowserWindow._useQtHelp and |
|
3579 not self.__indexing and |
|
3580 self.__searchWord is not None |
|
3581 ): |
3556 self.__searchDock.show() |
3582 self.__searchDock.show() |
3557 self.__searchDock.raise_() |
3583 self.__searchDock.raise_() |
3558 query = QHelpSearchQuery(QHelpSearchQuery.DEFAULT, |
3584 query = QHelpSearchQuery(QHelpSearchQuery.DEFAULT, |
3559 [self.__searchWord]) |
3585 [self.__searchWord]) |
3560 self.__searchEngine.search([query]) |
3586 self.__searchEngine.search([query]) |
3653 |
3679 |
3654 def __clearPrivateData(self): |
3680 def __clearPrivateData(self): |
3655 """ |
3681 """ |
3656 Private slot to clear the private data. |
3682 Private slot to clear the private data. |
3657 """ |
3683 """ |
3658 from .WebBrowserClearPrivateDataDialog import \ |
3684 from .WebBrowserClearPrivateDataDialog import ( |
3659 WebBrowserClearPrivateDataDialog |
3685 WebBrowserClearPrivateDataDialog |
|
3686 ) |
3660 dlg = WebBrowserClearPrivateDataDialog(self) |
3687 dlg = WebBrowserClearPrivateDataDialog(self) |
3661 if dlg.exec_() == QDialog.Accepted: |
3688 if dlg.exec_() == QDialog.Accepted: |
3662 # browsing history, search history, favicons, disk cache, cookies, |
3689 # browsing history, search history, favicons, disk cache, cookies, |
3663 # passwords, web databases, downloads, Flash cookies |
3690 # passwords, web databases, downloads, Flash cookies |
3664 (history, searches, favicons, cache, cookies, |
3691 (history, searches, favicons, cache, cookies, |
3947 |
3974 |
3948 @return reference to the personal information manager |
3975 @return reference to the personal information manager |
3949 (PersonalInformationManager) |
3976 (PersonalInformationManager) |
3950 """ |
3977 """ |
3951 if cls._personalInformationManager is None: |
3978 if cls._personalInformationManager is None: |
3952 from .PersonalInformationManager.PersonalInformationManager \ |
3979 from .PersonalInformationManager import PersonalInformationManager |
3953 import PersonalInformationManager |
3980 cls._personalInformationManager = ( |
3954 cls._personalInformationManager = PersonalInformationManager() |
3981 PersonalInformationManager.PersonalInformationManager() |
|
3982 ) |
3955 |
3983 |
3956 return cls._personalInformationManager |
3984 return cls._personalInformationManager |
3957 |
3985 |
3958 @classmethod |
3986 @classmethod |
3959 def greaseMonkeyManager(cls): |
3987 def greaseMonkeyManager(cls): |
3975 |
4003 |
3976 @return reference to the feature permission manager |
4004 @return reference to the feature permission manager |
3977 @rtype FeaturePermissionManager |
4005 @rtype FeaturePermissionManager |
3978 """ |
4006 """ |
3979 if cls._featurePermissionManager is None: |
4007 if cls._featurePermissionManager is None: |
3980 from .FeaturePermissions.FeaturePermissionManager import \ |
4008 from .FeaturePermissions.FeaturePermissionManager import ( |
3981 FeaturePermissionManager |
4009 FeaturePermissionManager |
|
4010 ) |
3982 cls._featurePermissionManager = FeaturePermissionManager() |
4011 cls._featurePermissionManager = FeaturePermissionManager() |
3983 |
4012 |
3984 return cls._featurePermissionManager |
4013 return cls._featurePermissionManager |
3985 |
4014 |
3986 @classmethod |
4015 @classmethod |
3990 |
4019 |
3991 @return reference to the flash cookies manager |
4020 @return reference to the flash cookies manager |
3992 @rtype FlashCookieManager |
4021 @rtype FlashCookieManager |
3993 """ |
4022 """ |
3994 if cls._flashCookieManager is None: |
4023 if cls._flashCookieManager is None: |
3995 from .FlashCookieManager.FlashCookieManager import \ |
4024 from .FlashCookieManager.FlashCookieManager import ( |
3996 FlashCookieManager |
4025 FlashCookieManager |
|
4026 ) |
3997 cls._flashCookieManager = FlashCookieManager() |
4027 cls._flashCookieManager = FlashCookieManager() |
3998 |
4028 |
3999 return cls._flashCookieManager |
4029 return cls._flashCookieManager |
4000 |
4030 |
4001 @classmethod |
4031 @classmethod |
4005 |
4035 |
4006 @return reference to the image finder object |
4036 @return reference to the image finder object |
4007 @rtype ImageSearchEngine |
4037 @rtype ImageSearchEngine |
4008 """ |
4038 """ |
4009 if cls._imageSearchEngine is None: |
4039 if cls._imageSearchEngine is None: |
4010 from .ImageSearch.ImageSearchEngine import \ |
4040 from .ImageSearch.ImageSearchEngine import ( |
4011 ImageSearchEngine |
4041 ImageSearchEngine |
|
4042 ) |
4012 cls._imageSearchEngine = ImageSearchEngine() |
4043 cls._imageSearchEngine = ImageSearchEngine() |
4013 |
4044 |
4014 return cls._imageSearchEngine |
4045 return cls._imageSearchEngine |
4015 |
4046 |
4016 @classmethod |
4047 @classmethod |
4137 @type list of str |
4168 @type list of str |
4138 @param parentMenu reference to the parent menu |
4169 @param parentMenu reference to the parent menu |
4139 @type QMenu |
4170 @type QMenu |
4140 """ |
4171 """ |
4141 if codecNames: |
4172 if codecNames: |
4142 defaultCodec = \ |
4173 defaultCodec = self.webSettings().defaultTextEncoding().lower() |
4143 self.webSettings().defaultTextEncoding().lower() |
|
4144 |
4174 |
4145 menu = QMenu(title, parentMenu) |
4175 menu = QMenu(title, parentMenu) |
4146 for codec in codecNames: |
4176 for codec in codecNames: |
4147 self.__createTextEncodingAction(codec, defaultCodec, menu) |
4177 self.__createTextEncodingAction(codec, defaultCodec, menu) |
4148 |
4178 |
4558 @type QEvent |
4588 @type QEvent |
4559 @return flag indicating a handled event |
4589 @return flag indicating a handled event |
4560 @rtype bool |
4590 @rtype bool |
4561 """ |
4591 """ |
4562 if evt.type() == QEvent.WindowStateChange: |
4592 if evt.type() == QEvent.WindowStateChange: |
4563 if not bool(evt.oldState() & Qt.WindowFullScreen) and \ |
4593 if ( |
4564 bool(self.windowState() & Qt.WindowFullScreen): |
4594 not bool(evt.oldState() & Qt.WindowFullScreen) and |
|
4595 bool(self.windowState() & Qt.WindowFullScreen) |
|
4596 ): |
4565 # enter full screen mode |
4597 # enter full screen mode |
4566 self.__windowStates = evt.oldState() |
4598 self.__windowStates = evt.oldState() |
4567 self.__toolbarStates = self.saveState() |
4599 self.__toolbarStates = self.saveState() |
4568 self.menuBar().hide() |
4600 self.menuBar().hide() |
4569 self.statusBar().hide() |
4601 self.statusBar().hide() |
4574 if toolbar is not self.__bookmarksToolBar: |
4606 if toolbar is not self.__bookmarksToolBar: |
4575 toolbar.hide() |
4607 toolbar.hide() |
4576 self.__navigationBar.exitFullScreenButton().setVisible(True) |
4608 self.__navigationBar.exitFullScreenButton().setVisible(True) |
4577 self.__navigationContainer.hide() |
4609 self.__navigationContainer.hide() |
4578 |
4610 |
4579 elif bool(evt.oldState() & Qt.WindowFullScreen) and \ |
4611 elif ( |
4580 not bool(self.windowState() & Qt.WindowFullScreen): |
4612 bool(evt.oldState() & Qt.WindowFullScreen) and |
|
4613 not bool(self.windowState() & Qt.WindowFullScreen) |
|
4614 ): |
4581 # leave full screen mode |
4615 # leave full screen mode |
4582 self.setWindowState(self.__windowStates) |
4616 self.setWindowState(self.__windowStates) |
4583 self.__htmlFullScreen = False |
4617 self.__htmlFullScreen = False |
4584 if Preferences.getWebBrowser("MenuBarVisible"): |
4618 if Preferences.getWebBrowser("MenuBarVisible"): |
4585 self.menuBar().show() |
4619 self.menuBar().show() |
4695 @param styleSheetFile name of the user style sheet file (string) |
4729 @param styleSheetFile name of the user style sheet file (string) |
4696 """ |
4730 """ |
4697 name = "_eric_userstylesheet" |
4731 name = "_eric_userstylesheet" |
4698 userStyle = "" |
4732 userStyle = "" |
4699 |
4733 |
4700 userStyle += WebBrowserTools.readAllFileContents(styleSheetFile)\ |
4734 userStyle += ( |
|
4735 WebBrowserTools.readAllFileContents(styleSheetFile) |
4701 .replace("\n", "") |
4736 .replace("\n", "") |
|
4737 ) |
4702 |
4738 |
4703 oldScript = self.webProfile().scripts().findScript(name) |
4739 oldScript = self.webProfile().scripts().findScript(name) |
4704 if not oldScript.isNull(): |
4740 if not oldScript.isNull(): |
4705 self.webProfile().scripts().remove(oldScript) |
4741 self.webProfile().scripts().remove(oldScript) |
4706 |
4742 |