24 pyqtSignal, |
24 pyqtSignal, |
25 pyqtSlot, |
25 pyqtSlot, |
26 ) |
26 ) |
27 from PyQt6.QtWidgets import QDialog |
27 from PyQt6.QtWidgets import QDialog |
28 |
28 |
29 from eric7 import Preferences, Utilities |
29 from eric7 import Globals, Preferences |
30 from eric7.EricWidgets import EricMessageBox |
30 from eric7.EricWidgets import EricMessageBox |
31 from eric7.WebBrowser.JavaScript.ExternalJsObject import ExternalJsObject |
31 from eric7.WebBrowser.JavaScript.ExternalJsObject import ExternalJsObject |
32 from eric7.WebBrowser.WebBrowserWindow import WebBrowserWindow |
32 from eric7.WebBrowser.WebBrowserWindow import WebBrowserWindow |
33 |
33 |
34 from .GreaseMonkeyJsObject import GreaseMonkeyJsObject |
34 from .GreaseMonkeyJsObject import GreaseMonkeyJsObject |
149 """ |
149 """ |
150 Public method to get the path of the scripts directory. |
150 Public method to get the path of the scripts directory. |
151 |
151 |
152 @return path of the scripts directory (string) |
152 @return path of the scripts directory (string) |
153 """ |
153 """ |
154 return os.path.join(Utilities.getConfigDir(), "web_browser", "greasemonkey") |
154 return os.path.join(Globals.getConfigDir(), "web_browser", "greasemonkey") |
155 |
155 |
156 def requireScriptsDirectory(self): |
156 def requireScriptsDirectory(self): |
157 """ |
157 """ |
158 Public method to get the path of the scripts directory. |
158 Public method to get the path of the scripts directory. |
159 |
159 |
339 collection = WebBrowserWindow.webProfile().scripts() |
339 collection = WebBrowserWindow.webProfile().scripts() |
340 collection.insert(script.webScript()) |
340 collection.insert(script.webScript()) |
341 |
341 |
342 self.__jsObject.setSettingsFile( |
342 self.__jsObject.setSettingsFile( |
343 os.path.join( |
343 os.path.join( |
344 Utilities.getConfigDir(), "web_browser", "greasemonkey_values.ini" |
344 Globals.getConfigDir(), "web_browser", "greasemonkey_values.ini" |
345 ) |
345 ) |
346 ) |
346 ) |
347 ExternalJsObject.registerExtraObject("GreaseMonkey", self.__jsObject) |
347 ExternalJsObject.registerExtraObject("GreaseMonkey", self.__jsObject) |
348 |
348 |
349 def __scriptChanged(self, script): |
349 def __scriptChanged(self, script): |