【发布时间】:2018-01-23 15:39:43
【问题描述】:
我正在制作一个 chrome 扩展,我想在其中更改“撰写”对话框的“发送”按钮的颜色。
最好的方法是什么?
提前致谢!
更新-
这里是我目前用来改变颜色的content.js的功能-
function modifySendButton(check, form) {
var send_button = $(form).siblings('table').find('div[role="button"][aria-label="Send (Ctrl-Enter)"]');
if (0 === send_button.length) {
send_button = $(this).siblings('table').find('div[role="button"][aria-label="Send (⌘Enter)"]');
}
if (true === check) {
send_button.addClass("active-send-button");
} else {
send_button.removeClass("active-send-button");
}
}
它正在改变发送按钮的颜色,但我想知道这样做是否正确?
【问题讨论】:
-
您是否尝试使用内容脚本创建扩展?
-
是的,我有一个内容脚本。
-
那么,您能与我们分享您的代码吗?你到底卡在哪里了?
-
你好@Deliaz,我已经添加了代码sn-p。请查看它并告诉我更改发送按钮颜色的正确方法是什么?