def start_chrome(use_default_chrome_profile=False): settings = sublime.load_settings('ChromeREPL.sublime-settings') chrome_port = settings.get('port') user_flags = settings.get('chrome_flags') flags = [ '--remote-debugging-port={}'.format(chrome_port), ] + user_flags if not use_default_chrome_profile: data_dir = tempfile.TemporaryDirectory() flags.append('--user-data-dir={}'.format(data_dir)) if settings.get('auto_open_devtools', True): flags.append('--auto-open-devtools-for-tabs') cmd = [ChromeREPLHelpers.get_chrome_path()] + flags try: subprocess.Popen(cmd) except Exception as e: sublime.error_message("Could not start Chrome, check the path in your settings") return False
def start_chrome(): settings = sublime.load_settings('ChromeREPL.sublime-settings') chrome_port = settings.get('port') user_flags = settings.get('chrome_flags') flags = ['--remote-debugging-port={}'.format(chrome_port)] + user_flags if settings.get('auto_open_devtools', True): flags.append('--auto-open-devtools-for-tabs') cmd = [ChromeREPLHelpers.get_chrome_path()] + flags try: subprocess.Popen(cmd) except Exception as e: sublime.error_message("Could not start Chrome, check the path in your settings") return False
def is_connected(self): return (self.chrome is not None and ChromeREPLHelpers.is_chrome_running_with_remote_debugging() and self.chrome.ws is not None and self.chrome.ws.connected)
def is_enabled(self): return ChromeREPLHelpers.is_chrome_running_with_remote_debugging()
def run(self): process = ChromeREPLHelpers.get_chrome_process() if process is not None: process.terminate() process.wait() start_chrome()
def is_enabled(self): return (ChromeREPLHelpers.is_chrome_running() and not ChromeREPLHelpers.is_remote_debugging_enabled())
def is_enabled(self): return not ChromeREPLHelpers.is_chrome_running()
def restart_chrome(self, use_default_chrome_profile): process = ChromeREPLHelpers.get_chrome_process() if process is not None: process.terminate() process.wait() start_chrome(use_default_chrome_profile)