prerender_rails_embedded 0.2.2 → 0.2.3
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 +16 -16
- data/prerender_rails_embedded.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MDA3ZDFiNWVkYWU3ZGU4NzgwMDM3YTQxMDc4NTNkZjgxNmM4Yzc4OQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NTlkNTgzOGIyNGZiZDlmMzkxNmU5NjVmM2JkMTYwMDcwMmFjMzU2Yw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OTcwNTUzYjdmZDIzZTJkYzczZjYzOTMyNmIwYTQ1Y2MzMGI0NDI3NzBhMTg5
|
10
|
+
MjQxNDY1MzQ0NzYwZmMzMjg4NjczOWUxN2VhNWU2YTFmNDA2ODBiZTBjMTA3
|
11
|
+
NWRhOTQ4YmMwZmM4YTFhZWQ3ODU2YWJmM2E1ZTg4MzNiZjczNWY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MmFjMThiYjdiYTJkNjhhNzBmMWQ1M2JlNzA0MjUyZDcyZTkwNDE4OTczYzEz
|
14
|
+
OWViMzUyYWRlM2VkY2M4YmJiMjk1MTMwNjlhOTI3ODQ2NzM1OTQ3YmExYTQx
|
15
|
+
ZWVlYTAyMTg4YTRiYjEzZDAzOWZmNGMwZjc5MzE1YjFiMjlkZTA=
|
@@ -18,7 +18,7 @@ page.viewportSize = {
|
|
18
18
|
|
19
19
|
surrender.params = function() {
|
20
20
|
if (system.args.length === 1) {
|
21
|
-
throw 'Usage:
|
21
|
+
throw 'Usage: prerender_rails_embedded.js <some URL>';
|
22
22
|
}
|
23
23
|
return { address: system.args[1]};
|
24
24
|
};
|
@@ -27,13 +27,13 @@ surrender.params = function() {
|
|
27
27
|
surrender.javascriptToExecuteOnPage = function() {
|
28
28
|
var processHtml = function() {
|
29
29
|
if (!window.prerenderRailsEmbedded || !window.prerenderRailsEmbedded.filterHtmlOutput || typeof(window.prerenderRailsEmbedded.filterHtmlOutput) !== "function") {
|
30
|
-
return document.documentElement.
|
30
|
+
return document.documentElement.outerHTML;
|
31
31
|
} else {
|
32
32
|
return window.prerenderRailsEmbedded.filterHtmlOutput.call(this);
|
33
33
|
}
|
34
34
|
};
|
35
35
|
|
36
|
-
try {
|
36
|
+
try {
|
37
37
|
|
38
38
|
if (!document) {
|
39
39
|
throw 'document is undefined. this function must be called inside page.evaluate ';
|
@@ -55,9 +55,9 @@ surrender.javascriptToExecuteOnPage = function() {
|
|
55
55
|
shouldWaitForPrerenderReady: typeof window.prerenderReady === 'boolean',
|
56
56
|
prerenderReady: window.prerenderReady
|
57
57
|
};
|
58
|
-
|
58
|
+
|
59
59
|
} catch (e) {
|
60
|
-
console.log('ERROR: ', e);
|
60
|
+
//console.log('ERROR: ', e);
|
61
61
|
return {
|
62
62
|
html: '',
|
63
63
|
shouldWaitForPrerenderReady: false,
|
@@ -98,19 +98,19 @@ surrender.run = function() {
|
|
98
98
|
}
|
99
99
|
|
100
100
|
page.onError = function(msg, trace) {
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
101
|
+
// var msgStack = ['ERROR: ' + msg];
|
102
|
+
// if (trace && trace.length) {
|
103
|
+
// msgStack.push('TRACE:');
|
104
|
+
// trace.forEach(function(t) {
|
105
|
+
// msgStack.push(' -> ' + t.file + ': ' + t.line + (t.function ? ' (in function "' + t.function +'")' : ''));
|
106
|
+
// });
|
107
|
+
// }
|
108
|
+
// console.log(msgStack.join('\n'));
|
109
109
|
};
|
110
110
|
|
111
|
-
|
112
|
-
|
113
|
-
|
111
|
+
page.onConsoleMessage = function(msg, lineNum, sourceId) {
|
112
|
+
//console.log('CONSOLE: ' + msg + ' (from line #' + lineNum + ' in "' + sourceId + '")');
|
113
|
+
};
|
114
114
|
};
|
115
115
|
|
116
116
|
surrender.removeEscapedFragmentParameter = function (addressUrl) {
|
@@ -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.3'
|
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}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prerender_rails_embedded
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gian Carlo Pace
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-01-
|
12
|
+
date: 2015-01-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|