【发布时间】:2016-07-18 23:26:17
【问题描述】:
(链接到 git:https://github.com/Boundarybreaker/NameBlock)
我正在开发一个文本替换扩展程序,可以通过单击popup.html 中的按钮来打开和关闭它,但只有当我单击图标时才会发生这种情况。 (视频:https://drive.google.com/file/d/0B_3pLT_KI8V8OHJFUHQ5a1JURkE/view?usp=sharing)
按钮的代码为<button class="ui fluid red button" onclick=toggleActive() id="toggle">Toggle Active</button>,toggleActive() 是background.js 中的一个函数,还有一个侦听器chrome.runtime.onMessage.addListener(toggleActive);。如何让按钮正常工作?
【问题讨论】:
标签: javascript html css google-chrome google-chrome-extension