Bypassing the “no popup” if I want a javascript to run when extension clicked

依然范特西╮ 提交于 2019-12-06 10:06:45
sowbug

Add an onload listener into your popup.js:

onload = function() { console.log("I loaded!"); };

In that function you can do interesting things when the popup appears. If you want to get more fancy than that, you might run into issues described in https://code.google.com/p/chromium/issues/detail?id=31262.

By the way, you haven't told us what "It doesn't work" means (which line fails? Are there console error messages?), so it's hard to be sure that this answer (or any) is helpful to you. See https://meta.stackexchange.com/questions/156810/stack-overflow-question-checklist for steps to follow to make sure that answers given are answers to your question.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!