--- a/WebBrowser/WebBrowserTabWidget.py Sat Apr 07 16:40:21 2018 +0200 +++ b/WebBrowser/WebBrowserTabWidget.py Sun Apr 08 15:54:34 2018 +0200 @@ -560,6 +560,16 @@ for index in range(self.count() - 1, -1, -1): self.closeBrowserAt(index, shutdown=shutdown) + def closeBrowserView(self, browser): + """ + Public method to close the given browser. + + @param browser reference to the web browser view to be closed + @type WebBrowserView + """ + index = self.indexOf(browser) + self.closeBrowserAt(index) + def closeBrowserAt(self, index, shutdown=False): """ Public slot to close a browser based on its index. @@ -1050,6 +1060,22 @@ """ return self.__stackedUrlBar.currentWidget() + def urlBarForView(self, view): + """ + Public method to get a reference to the UrlBar associated with the + given view. + + @param view reference to the view to get the urlbar for + @type WebBrowserView + @return reference to the associated urlbar + @rtype UrlBar + """ + for urlbar in self.__stackedUrlBar.urlBars(): + if urlbar.browser() is view: + return urlbar + + return None + def __lineEditReturnPressed(self, edit): """ Private slot to handle the entering of an URL.