문제

in firefox contenscript when i tried this method it is not working

var x = function(y) {
   return y * y;
};

in firefox they mdn page https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/function#Examples

but this function works very neatly in crome extension and it is a javascript function in my knowledge. thanks in advance

here is the test extension github

도움이 되었습니까?

해결책

I think you want to actually execute the function and pass a parameter in your test code, rather than just output the function definition to the console. So change:

console.log("x :", x);

to:

console.log("x :", x(2));
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top