Created
February 11, 2013 01:40
-
-
Save ciembor/4751901 to your computer and use it in GitHub Desktop.
Callback hell.
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
| function refresh() { | |
| chrome.windows.getAll(function(windows) { | |
| for (var i = 0; i < windows.length; i++) { | |
| chrome.tabs.getAllInWindow(windows[i].id, function(tabs) { | |
| chrome.storage.sync.get('active', function(object) { | |
| if (object.active !== undefined) { | |
| for (var j = 0; j < tabs.length; j++) { | |
| if (-1 !== object.active.indexOf(tabs[j].url)) { | |
| chrome.tabs.reload(tabs[j].id); | |
| } | |
| } | |
| } | |
| }); | |
| }); | |
| } | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dat way maybe?