, ? , 100% JavaScript. JavaScript "" (www.fallswoodsmith.com) . -. . . </rant>
,
script, , :
TypeError: 'undefined' is not a function (evaluating 'joinURL.bind(null, staticServerUrl)')
http://static.parastorage.com/services/santa-versions/1.150.0/main-r.js:353 in wixRenderSite
, polyfill Function.prototype.bind ( PhantomJS 1.x, ) -, URL- (.. onInitialized).
:
var page = require('webpage').create();
page.onInitialized = function () {
page.evaluate(function () {
var isFunction = function (obj) {
return typeof obj == 'function' || false;
};
var slice = Array.prototype.slice;
Function.prototype.bind = function bind(obj) {
var args = slice.call(arguments, 1);
var self = this;
var F = function () {};
var bounded = function() {
return self.apply(
this instanceof F ? this : (obj || {}),
args.concat(slice.call(arguments))
);
};
F.prototype = this.prototype || {};
bounded.prototype = new F();
return bounded;
};
});
};
page.open('http://www.fallswoodsmith.com', function () {
setTimeout(function screenshot() {
page.render('WORKS.png', {
format: 'png',
quality: '10',
});
phantom.exit();
}, 10 * 1000);
});
10 , ? , JS, ( ), , . . - .
: WORKS.png.
PhantomJS
PhantomJS 1.9.7. script, , PhantomJS 1.9.8, 1.9.8 ( JavaScript 1.9.8), , , :
Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL file://28011634.js. Domains, protocols and ports must match.
Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL file://28011634.js. Domains, protocols and ports must match.
Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL file://28011634.js. Domains, protocols and ports must match.
Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL file://28011634.js. Domains, protocols and ports must match.
. , script:
page.viewportSize = {
width: 1024,
height: 768
};
page.clipRect = {
top: 0,
left: 0,
width: 1024,
height: 768
};
.bind
polyfill MDN, , - , .js .