Created
September 22, 2012 19:46
-
-
Save ilmsg/3767573 to your computer and use it in GitHub Desktop.
This file contains 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
chrome.tabs.onUpdated.addListener(function() { | |
var lis = this; | |
chrome.tabs.getAllInWindow(null, function(tabs) { | |
for (var i = 0; i < tabs.length; i++) { | |
if (tabs[i].url.indexOf("http://localhost:7002/auth") == 0) { | |
var token = tabs[i].url.match(/[\\?&#]access_token=([^&#])*/i); | |
TLab.setAccessToken(token); | |
alert('token : '+TLab.getAccessToken()); | |
chrome.tabs.onUpdated.removeListener(lis); | |
return; | |
} | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment