惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
T
Threatpost
阮一峰的网络日志
阮一峰的网络日志
美团技术团队
F
Fortinet All Blogs
The GitHub Blog
The GitHub Blog
月光博客
月光博客
V
Visual Studio Blog
T
Tailwind CSS Blog
Stack Overflow Blog
Stack Overflow Blog
博客园 - 聂微东
Jina AI
Jina AI
J
Java Code Geeks
Martin Fowler
Martin Fowler
大猫的无限游戏
大猫的无限游戏
Recorded Future
Recorded Future
C
Check Point Blog
腾讯CDC
N
Netflix TechBlog - Medium
aimingoo的专栏
aimingoo的专栏
罗磊的独立博客
Hacker News: Ask HN
Hacker News: Ask HN
SecWiki News
SecWiki News
博客园 - Franky
Hacker News - Newest:
Hacker News - Newest: "LLM"
N
News | PayPal Newsroom
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
Security @ Cisco Blogs
W
WeLiveSecurity
The Last Watchdog
The Last Watchdog
Cloudbric
Cloudbric
F
Full Disclosure
The Cloudflare Blog
Y
Y Combinator Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
S
Schneier on Security
Schneier on Security
Schneier on Security
Spread Privacy
Spread Privacy
L
LINUX DO - 热门话题
AI
AI
N
News and Events Feed by Topic
T
Tor Project blog
P
Palo Alto Networks Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
G
Google Developers Blog

博客园 - DataFlow

word break 在不同浏览器中的表现 系统架构 创造HTTPS的是个神 Javascript 控制style 小结 svcutil 生成代理类时的问题 xeam Build Definition Extension uninstall 卸载 Wcf客户端配置里Endpoint的Name属性无效 屏蔽电信流氓弹出广告 正则替换中的一个Bug SQL server 性能相关 SQL Express 相关 时间格式 输出一个在没有.Net 环境的机器也可以跑得安装包 再谈性能力 SCOM Configuration NumSamples and Absolute XML中的时间 decimal.Round 的区别 Dos中常用的命令 反序列化怪现象,数组无父
为Chrome开发插件提高工作效率
DataFlow · 2018-03-16 · via 博客园 - DataFlow

工作生活,什么最珍贵,我觉得是时间,怎么节约时间是一个最重要的问题,如果你有重复的工作在网页上,请接着看

上手步骤:

  • 打开https://developer.chrome.com/extensions/getstarted,分别下载需要的文件(3个)到一个文件夹
  • 打开chrome://extensions,选中开发模式,加载这个文件夹
  • 浏览右方就出现一个图标,你就可以试试这个demo了

开发步骤:

现在可以写个自己想要的东西了

  • 用喜欢的文件编辑器打开popup.html,加上自己想要的按钮,UI,标记好ID好关联点击事件
  • 打开popup.js, 给相关的DOM添加点击方法
document.addEventListener('DOMContentLoaded', () => {

    var btnAdd = document.getElementById('btnAdd');
    btnAdd.addEventListener('click', () => {
        openAddPage();
    });

...
  • 保存后,不需要重新加载,再次点击浏览器右上方的图标,打开你的插件,就已经加载了最新的代码,这个要给google一个赞
  • 需要注意的是,插件中不可以调用原页面代码中的方法或者对象,只能选取DOM元素,然后操作像下面一样
if(document.querySelector('.button').innerText == 'Add'){document.querySelector('.button').click()};
  • 问题是怎么知道你写的代码是工作的呢?如果需要不停的重试,那效率就太差了,Google已经帮你想到,答案就是,打开浏览器的调试模式(F12),切换到控制台,在里面可以直接打入代码,验证代码是否可以工作,Google是走心的
  • 把调试正确后的代码合并到popup.js
  • 到这里相信你已经大功造成。