我想呼吁的内容指令(Chrome扩展程序)动态功能。但常用的方式不起作用:Chrome扩展:内容脚本 - >动态功能
chrome.extension.onRequest.addListener(function cs_listener(request, sender, sendResponse) {
[request.action]();
}
request.action is blah。功能blah()是一个....现在它来...一个功能!
错误抛出:
Error in event handler for 'undefined': TypeError: object is not a function
有人拿到过这个?我真的不喜欢为我需要的每一个行动开关。
呀,窗口[request.action]();作品。奇怪,我之前尝试过,但没有奏效。打字问好。不管怎样,谢谢! –