Skip to content

Commit

Permalink
feat!: remove automatic kill of current browser sessions, seems no lo…
Browse files Browse the repository at this point in the history
…nger necessary and can get annoying

BREAKING CHANGE: Functionality that would automatically close current browser sessions on start up has been removed in favor of letting the user handle process management (I.E. too much responsibility)
  • Loading branch information
foxxyz committed Jan 19, 2020
1 parent bf741de commit 7d344f6
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 20 deletions.
3 changes: 0 additions & 3 deletions multibrowse.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
# Init associated system
platform = System()

# Close existing windows
platform.close_existing_browsers()

# Sort displays by y, then by x for consistent ordering
displays = sorted(sorted(platform.displays, key=itemgetter('x')), key=itemgetter('y'))

Expand Down
5 changes: 0 additions & 5 deletions systems/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ def browser_path(self):
"Return the path to the Chrome executable"
pass

@abstractmethod
def close_existing_browsers(self):
"Close all existing instances of Chrome"
pass

@abstractmethod
def displays(self):
"Return info about attached displays and their properties"
Expand Down
3 changes: 0 additions & 3 deletions systems/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ def browser_path(self):
pass
raise FileNotFoundError("No supported browsers found!")

def close_existing_browsers(self):
return call(['killall', '-9', 'chrome'], stdout=DEVNULL, stderr=DEVNULL)

@property
@lru_cache()
def displays(self):
Expand Down
6 changes: 0 additions & 6 deletions systems/mac.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ class System(BaseSystem):
def browser_path(self):
return os.path.join('/', 'Applications', 'Google Chrome.app', 'Contents', 'MacOS', 'Google Chrome')

def close_existing_browsers(self):
result = call(['killall', 'Google Chrome'], stdout=DEVNULL, stderr=DEVNULL)
# Give some time to shut down
sleep(2)
return result

@property
@lru_cache()
def displays(self):
Expand Down
3 changes: 0 additions & 3 deletions systems/win.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ class System(BaseSystem):
def browser_path(self):
return os.path.join('C:\\', 'Program Files (x86)', 'Google', 'Chrome', 'Application', 'chrome.exe')

def close_existing_browsers(self):
return call('taskkill /f /im chrome.exe', stdout=DEVNULL, stderr=DEVNULL)

@property
@lru_cache()
def displays(self):
Expand Down

0 comments on commit 7d344f6

Please sign in to comment.