--- a/WebBrowser/JavaScript/ExternalJsObject.py Tue Mar 15 19:47:54 2016 +0100 +++ b/WebBrowser/JavaScript/ExternalJsObject.py Tue Mar 15 21:15:07 2016 +0100 @@ -88,3 +88,26 @@ WebBrowser.WebBrowserWindow.WebBrowserWindow.passwordManager()\ .formSubmitted(urlStr, userName, password, data, self.page()) + + @pyqtSlot(result=str) + def providerString(self): + """ + Public method to get a string for the search provider. + + @return string for the search provider (string) + """ + return (self.tr("Search results provided by {0}") + .format(self.__page.view().mainWindow().openSearchManager() + .currentEngineName())) + + @pyqtSlot(str, result=str) + def searchUrl(self, searchStr): + """ + Public method to get the search URL for the given search term. + + @param searchStr search term (string) + @return search URL (string) + """ + return bytes( + self.__page.view().mainWindow().openSearchManager().currentEngine() + .searchUrl(searchStr).toEncoded()).decode()