7 Star 21 Fork 7

Chrome-Plugins/view-password

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
background.js 827 Bytes
一键复制 编辑 原始数据 按行查看 历史
Crazy_Coder 提交于 2017-03-02 00:19 +08:00 . first commit
/**
* Created by sunhao on 2017/2/23.
*/
var cache = {};
chrome.browserAction.onClicked.addListener(function (tab) {
var id = tab.id;
var show = cache[id] == undefined ? false : cache[id];
if (!show) {
cache[tab.id] = true;
chrome.browserAction.setIcon({
path: '../icons/icon-enabled.png',
tabId: tab.id
});
chrome.tabs.executeScript(tab.id, {file: "content.js", runAt: "document_end"});
} else {
cache[tab.id] = false;
chrome.browserAction.setIcon({
path: '../icons/icon-disabled.png',
tabId: tab.id
});
chrome.tabs.executeScript(tab.id, {code: "var eles = document.getElementsByName('showPassword');for(var i = 0; i < eles.length; i++){eles[i].parentNode.removeChild(eles[i]);}"});
}
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/chrome-plugins/view-password.git
git@gitee.com:chrome-plugins/view-password.git
chrome-plugins
view-password
view-password
master

搜索帮助