Last active
August 29, 2015 14:02
-
-
Save richsilv/b5e41fbd6e66cc135a60 to your computer and use it in GitHub Desktop.
Some simple utilities for interrogating a Meteor.js website in bookmarklet format.
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
javascript: (function() { | |
var getCollections = function() { | |
var collections = []; | |
for (var item in window) { | |
if (window[item] && window[item]['_collection']) collections.push(item); | |
} | |
return collections; | |
}; | |
var getSubscriptions = function() { | |
var thisSub, subs = {}; | |
for (sub in Meteor.connection._subscriptions) { | |
thisSub = Meteor.connection._subscriptions[sub]; | |
if (!subs[thisSub.name]) { | |
subs[thisSub.name] = [thisSub.params]; | |
} else { | |
subs[thisSub.name].push(thisSub.params); | |
} | |
} | |
return subs; | |
}; | |
Meteor.Snippet = { | |
getCollections: getCollections, | |
getSubscriptions: getSubscriptions | |
} | |
}()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment