javascript - Math.log10 is undefined/available in PhantomJS -
typeerror: undefined not function (evaluating 'math.log10(10)')
how solve problem if can't change source code of project?
i can change code of phantomjs script.
this question can anwsered in part this question. difference how proper way of injecting solution code.
if page needs function, can add it. use example polyfill provided mdn.
the polyfill must applied possible. done registering page.oninitialized
event handler:
page.oninitialized = function(){ page.evaluate(function(){ math.log10 = math.log10 || function(x) { return math.log(x) / math.ln10; }; }); };
this works in phantomjs versions.
Comments
Post a Comment