Creating a Chrome extension requires a manifest.json file which defines how your extension will behave. With a minimal setup, you can already manipulate pages and change elements. This lesson walks you through creating a manifest.json file which will essentially "block" twitter and reddit and tell you to get back to work.

manifest.json:

{
"name": "Back to Work!!",
"version": "1.0",
"manifest_version": 2,
"content_scripts": [{
"js": ["inject.js"],
"matches": [
"https://twitter.com/*",
"https://*.reddit.com/*"
]
}]
}

inject.js:

document.body.innerHTML = `
Back to Work!!
`

Go to chrome://extensions .

Click "Load unpacked" folder.

Then when you visit twitter, it will show "Back to Work!!" in html.

[Tools] Create a Chrome Extension的更多相关文章

  1. chrome extension overview

    目录 什么是扩展............................................................................................ ...

  2. chrome extension demos

    chrome extension demos demo https://github.com/hartleybrody/buzzkill/blob/master/bootstrap.js https: ...

  3. Chrome插件:微信公众号自动登录(chrome.extension)

    manifest.json: { "manifest_version": 2, "name": "WX.AutoLogin", " ...

  4. Make chrome extension

    How to Make a Chrome Extension. https://robots.thoughtbot.com/how-to-make-a-chrome-extension Skip to ...

  5. Chrome Extension 检查视图(无效)处理方法

    最近闲来无事,简单看了下Chrome扩展的开发,并且开发一个小小的翻译插件(TranslateBao)作为练手,开发细节不详述了,如果有新学习chrome extension开发的新人,可以参考源码, ...

  6. 开发Chrome Extension截取你微博的帐号密码

    Google允许开发者对Chrome浏览器做扩展,所以有了之前火爆的12306抢票软件,我 也用它抢过票,一直很好奇它怎么注入js到12306上面的.这周有空研究了下Chrome Extension, ...

  7. 打包Egret游戏为Chrome extension

    今天,本来是打算做一个Chrome扩展去爬取网站base64编码图片的. 在跟着图灵社区<Chrome扩展及应用开发>敲demo代码的过程中,发现chrome的扩展的结构理论上可以兼容所有 ...

  8. Google Chrome Native Messaging开发实录(二)Chrome Extension扩展

    接上一篇<Google Chrome Native Messaging开发实录(一)背景介绍>的项目背景,话不多说,有关Chrome Extension介绍和文档就不展开了,直接上代码. ...

  9. Chrome Extension 实战

    想起个问题,线上项目js要有bug,怎么进行调试修改. ------------- 想起来,方法应该是,拦截线上的js的请求,转到本地代码上进行调试... ------------- 网上看到 Chr ...

随机推荐

  1. 树状数组 || POJ 2352 Stars

    Astronomers often examine star maps where stars are represented by points on a plane and each star h ...

  2. hibernate5.x版本org.hibernate.MappingException: Unknown entity问题

    /* * //创建hibernate配置对象 Configuration cfg = new Configuration(); cfg.configure("hibernate.cfg.xm ...

  3. C字符串指针遇到的问题

    看下面的示例代码: int main() { char *ptr = "GeeksQuiz"; printf("%c\n", *&*&*ptr) ...

  4. 智能指针unqiue_ptr

    unique_ptr unique_ptr 对它指向的对象在同一时刻是独占的.它要么在构造的时候使用内置指针初始化,要么使用reset给其赋值.当unique_ptr被销毁时,它所指向的对象也被销毁. ...

  5. Linux网络技术管理

    1. OSI七层模型和TCP/IP四层模型 1.1 osi 七层模型 Open System interconnection,开放系统互连参考模型是国际标准化组织(ISO)制定的一个用于计算机或通信系 ...

  6. linux破解root登录密码,并重置

    重启系统后按'e'键,进入编辑模式,在'UTF -8'后空格输入'rd.break'后,按快捷键'Ctrl+X'进入新界面进行编辑,代码如下: switch_root:/# mount -o remo ...

  7. UVa 12118 检查员的难题 (dfs判连通, 构造欧拉通路)

    题意: 分析: 欧拉通路:图连通:图中只有0个或2个度为奇数的结点 这题我们只需要判断选择的边构成多少个联通块, 再记录全部联通块一共有多少个奇度顶点. 然后我们在联通块中连线, 每次连接两个联通块就 ...

  8. 在html借助元素特性存储信息

    背景:比如存在学生选择的CheckBox,希望在CheckBox中同时存储学生的姓名及其所在的城市,比如选择Lily所对应的CheckBox以后,可以获得Lily所在的城市“NewYork”. htm ...

  9. 可编辑div的createRange()

    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 // 在元素的指定位 ...

  10. bootspring网站项目,Date类型插入数据库始终比正确时间早一天问题的解决

    bug描述 昨天的Date插入不进去问题解决后,一直没发现其实插入的时间一直比正确的时间早一天 输出sql语句,发现insert语句还是对的,不知道为什么插入数据库之后结果就早了一天 https:// ...