Skip to content

Instantly share code, notes, and snippets.

@uhunkler
Created April 27, 2013 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uhunkler/5473422 to your computer and use it in GitHub Desktop.
Save uhunkler/5473422 to your computer and use it in GitHub Desktop.
browser connection - JSTalk
// 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