Created
April 27, 2013 15:07
-
-
Save uhunkler/5473422 to your computer and use it in GitHub Desktop.
browser connection - JSTalk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create the connection to the browser | |
var browsername = "Safari", | |
// var browsername = "Google Chrome", | |
browser = SBApplication.application( browsername ), | |
win = browser.windows()[0], | |
tab = null; | |
// get the active tab | |
if( browsername === "Safari" || browsername === "WebKit" ) | |
{ | |
tab = win.currentTab(); | |
} | |
else if( browsername === "Google Chrome" ) | |
{ | |
tab = win.activeTab(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment