diff --git a/packages/spiderable/package.js b/packages/spiderable/package.js index 425c2ae8bb..431cc5c77e 100644 --- a/packages/spiderable/package.js +++ b/packages/spiderable/package.js @@ -7,6 +7,8 @@ Package.on_use(function (api) { api.use(['templating'], 'client'); api.use(['underscore'], ['client', 'server']); + api.export('Spiderable', 'server'); + api.add_files('spiderable.html', 'client'); api.add_files('spiderable.js', 'server'); }); diff --git a/packages/spiderable/spiderable.js b/packages/spiderable/spiderable.js index 2e5bd04c4a..9bc8f8118f 100644 --- a/packages/spiderable/spiderable.js +++ b/packages/spiderable/spiderable.js @@ -9,7 +9,13 @@ Spiderable = {}; // not obey the _escaped_fragment_ protocol. The page is served // statically to any client whos user agent matches any of these // regexps. Users may modify this array. -Spiderable.userAgentRegExps = [/^facebookexternalhit/i, /^linkedinbot/i]; +// +// An original goal with the spiderable package was to avoid doing +// user-agent based tests. But the reality is not enough bots support +// the _escaped_fragment_ protocol, so we need to hardcode a list +// here. I shed a silent tear. +Spiderable.userAgentRegExps = [ + /^facebookexternalhit/i, /^linkedinbot/i, /^twitterbot/i]; // how long to let phantomjs run before we kill it var REQUEST_TIMEOUT = 15*1000;