851 self.__clickedPos = self.mapToViewport(pos) |
851 self.__clickedPos = self.mapToViewport(pos) |
852 |
852 |
853 from .Tools import Scripts |
853 from .Tools import Scripts |
854 script = Scripts.getFormData(self.__clickedPos) |
854 script = Scripts.getFormData(self.__clickedPos) |
855 self.page().runJavaScript( |
855 self.page().runJavaScript( |
856 script, lambda res: self.__checkForFormCallback(res, act)) |
856 script, |
|
857 WebBrowserPage.SafeJsWorld, |
|
858 lambda res: self.__checkForFormCallback(res, act)) |
857 |
859 |
858 def __checkForFormCallback(self, res, act): |
860 def __checkForFormCallback(self, res, act): |
859 """ |
861 """ |
860 Private method handling the __checkForForm result. |
862 Private method handling the __checkForForm result. |
861 |
863 |
1062 """ |
1064 """ |
1063 from .Tools import Scripts |
1065 from .Tools import Scripts |
1064 script = Scripts.getFormData(self.__clickedPos) |
1066 script = Scripts.getFormData(self.__clickedPos) |
1065 self.page().runJavaScript( |
1067 self.page().runJavaScript( |
1066 script, |
1068 script, |
|
1069 WebBrowserPage.SafeJsWorld, |
1067 lambda res: self.__mw.openSearchManager().addEngineFromForm( |
1070 lambda res: self.__mw.openSearchManager().addEngineFromForm( |
1068 res, self)) |
1071 res, self)) |
1069 |
1072 |
1070 def __webInspector(self): |
1073 def __webInspector(self): |
1071 """ |
1074 """ |
1095 Public slot to bookmark the current page. |
1098 Public slot to bookmark the current page. |
1096 """ |
1099 """ |
1097 from .Tools import Scripts |
1100 from .Tools import Scripts |
1098 script = Scripts.getAllMetaAttributes() |
1101 script = Scripts.getAllMetaAttributes() |
1099 self.page().runJavaScript( |
1102 self.page().runJavaScript( |
1100 script, self.__addBookmarkCallback) |
1103 script, WebBrowserPage.SafeJsWorld, self.__addBookmarkCallback) |
1101 |
1104 |
1102 def __addBookmarkCallback(self, res): |
1105 def __addBookmarkCallback(self, res): |
1103 """ |
1106 """ |
1104 Private callback method of __addBookmark(). |
1107 Private callback method of __addBookmark(). |
1105 |
1108 |
1655 |
1658 |
1656 def __addSpeedDial(self): |
1659 def __addSpeedDial(self): |
1657 """ |
1660 """ |
1658 Private slot to add a new speed dial. |
1661 Private slot to add a new speed dial. |
1659 """ |
1662 """ |
1660 self.__page.runJavaScript("addSpeedDial();") |
1663 self.__page.runJavaScript("addSpeedDial();", |
|
1664 WebBrowserPage.SafeJsWorld) |
1661 |
1665 |
1662 def __configureSpeedDial(self): |
1666 def __configureSpeedDial(self): |
1663 """ |
1667 """ |
1664 Private slot to configure the speed dial. |
1668 Private slot to configure the speed dial. |
1665 """ |
1669 """ |
1666 self.page().runJavaScript("configureSpeedDial();") |
1670 self.page().runJavaScript("configureSpeedDial();", |
|
1671 WebBrowserPage.SafeJsWorld) |
1667 |
1672 |
1668 def __reloadAllSpeedDials(self): |
1673 def __reloadAllSpeedDials(self): |
1669 """ |
1674 """ |
1670 Private slot to reload all speed dials. |
1675 Private slot to reload all speed dials. |
1671 """ |
1676 """ |
1672 self.page().runJavaScript("reloadAll();") |
1677 self.page().runJavaScript("reloadAll();", WebBrowserPage.SafeJsWorld) |
1673 |
1678 |
1674 def __resetSpeedDials(self): |
1679 def __resetSpeedDials(self): |
1675 """ |
1680 """ |
1676 Private slot to reset all speed dials to the default pages. |
1681 Private slot to reset all speed dials to the default pages. |
1677 """ |
1682 """ |