prerender_rails_embedded 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/prerender_rails_embedded.js +5 -4
- data/prerender_rails_embedded.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YTNiZmE4NWJhYTNhOGQ0ZDkwY2M1ZGVhNzEwOTkxNjBjNWNjYTRlMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MWE3Yzk0NmNkMGJmYWVjMzBlMDljYTU3NzUxODc2NGRlMzYyMWUyMw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MjM1ZTBjMGMwYmY2YmNhMmQ1ZTlmNGZiMDdjMDIzOTZlY2I4YjEyYmQ5Yjk1
|
10
|
+
MDVhNmE0YzRkYTUxNzA5ZWI0YmIxNTI4YTdlNDk3Y2VhNzY2NDBlOWVlN2Nk
|
11
|
+
NWNlMzhmODQ0ZGUzZDQ1ZDNjMDYzY2I3NjlhYWQ5NWFlMzcyNmE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZjNkOTAxODk3MDU1OTgzYTE2ZGNlOGYyYzQ4ZWIyZmY4NTI4ZmQ3OGJmZDE2
|
14
|
+
NzUwNTViZGY5NTllMGFjY2Q5OWQyNjNiYmIxMjQ1ZTgyY2IwMDk2YzRmY2U3
|
15
|
+
Y2QwNWQ3YWQ1OWQ1MTA5ZDRkYWMwNzY1M2NkNTI5OGRkNGYzMzA=
|
@@ -1,6 +1,5 @@
|
|
1
1
|
/**
|
2
2
|
* TODO exceptions should exit immediately from phantomjs and they DON'T
|
3
|
-
* TODO add a timeout for too long connections
|
4
3
|
* TODO support 404 and error code in the same way prerender.io (server) does
|
5
4
|
* @type {number}
|
6
5
|
*/
|
@@ -72,14 +71,16 @@ surrender.serveHtml = function(html) {
|
|
72
71
|
phantom.exit();
|
73
72
|
};
|
74
73
|
|
75
|
-
surrender.evaluateJavascriptOnPage = function(t) {
|
74
|
+
surrender.evaluateJavascriptOnPage = function(t, msPassed) {
|
76
75
|
var _this = t || this
|
77
76
|
, out = page.evaluate(_this.javascriptToExecuteOnPage);
|
78
77
|
|
79
|
-
if
|
78
|
+
if (msPassed === undefined) msPassed = 0;
|
79
|
+
|
80
|
+
if(!out.shouldWaitForPrerenderReady || (out.shouldWaitForPrerenderReady && out.prerenderReady) || msPassed >= 20000) {
|
80
81
|
_this.serveHtml(out.html);
|
81
82
|
} else {
|
82
|
-
setTimeout(function(){_this.evaluateJavascriptOnPage(_this)}, EVALUATE_JAVASCRIPT_CHECK_TIMEOUT);
|
83
|
+
setTimeout(function(){_this.evaluateJavascriptOnPage(_this, msPassed + EVALUATE_JAVASCRIPT_CHECK_TIMEOUT)}, EVALUATE_JAVASCRIPT_CHECK_TIMEOUT);
|
83
84
|
}
|
84
85
|
return _this;
|
85
86
|
};
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'prerender_rails_embedded'
|
5
|
-
spec.version = '0.2.
|
5
|
+
spec.version = '0.2.6'
|
6
6
|
spec.authors = ['Gian Carlo Pace', 'Luca Mirra']
|
7
7
|
spec.email = %w(giancarlo.pace@etalia.net)
|
8
8
|
spec.description = %q{A plugin for prerender_rails middleware to render JavaScript web app on the fly calling phantomjs directly}
|