diff --git a/BrowserRefresh.py b/BrowserRefresh.py index 9fee847..3c83dfc 100644 --- a/BrowserRefresh.py +++ b/BrowserRefresh.py @@ -79,3 +79,6 @@ def run(self, args, activate=True, if 'palemoon' in browsers and _os == 'Windows': refresher.palemoon() + + if 'brave' in browsers and _os == 'Windows': + refresher.brave() diff --git a/linux/__init__.py b/linux/__init__.py index eaf4908..340ee18 100644 --- a/linux/__init__.py +++ b/linux/__init__.py @@ -34,6 +34,9 @@ def ie(self): pass # except NotImplemented("IE support not implemented yet.") + def brave(self): + self.SendKeysToAllWindows('brave-browser', 'F5') + def SendKeysToAllWindows(self, cls, key): "Sends the keystroke to all windows whose title matches the regex" diff --git a/win/__init__.py b/win/__init__.py index 3423651..94a4e2d 100644 --- a/win/__init__.py +++ b/win/__init__.py @@ -69,6 +69,12 @@ def ie(self): except WindowNotFoundError: pass + def brave(self): + try: + self.SendKeysToAllWindows('.*Brave') + except WindowNotFoundError: + pass + def SendKeysToAllWindows(self, title_regex): "Sends the keystroke to all windows whose title matches the regex"