Skip to content

Instantly share code, notes, and snippets.

@axiak
Created March 21, 2012 18:56
Show Gist options
  • Save axiak/2151274 to your computer and use it in GitHub Desktop.
Save axiak/2151274 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python2.7
import remote_webkit_debug
chrome = remote_webkit_debug.ChromeShell()
tab = chrome.pick_tab([
tab for tab in chrome.get_tabs()
if 'webSocketDebuggerUrl' in tab][0])
tab.send_command('Runtime.evaluate',
expression='window.location = window.location;',
objectGroup='1',
returnByValue=True)
"""
Step 1:
pip install remote-webkit-debug
Step 2:
(defun save-and-reload () "Save and reload browser" (interactive)
(save-buffer)
(shell-command "chrome-reload")
)
(define-key global-map "\C-x\C-r" 'save-and-reload)
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment