greasemonkey
Greasemonkey Hacks/Getting Started
< Greasemonkey Hacks
Greasemonkey Hacks
Foreword
Credits
Preface
Chapter 1: Getting Started
Chapter 2: Linkmania!
Chapter 3: Beautifying the Web
Chapter 4: Web Forms
Chapter 5: Developer Tools
Chapter 6: Search
Chapter 7: Web Mail
Chapter 8: Accessibility
Chapter 9: Taking Back the Browser
Chapter 10: Syndication
Chapter 11: Site Integration
Chapter 12: Those Not Included in This Classification
Colophon
Contents [hide]
1 Hacks 1–12: Introduction
2 Install a User Script
2.1 Installing from the Context Menu
2.2 Installing from the Tools Menu
2.3 Editing Greasemonkey's Configuration Files
3 Provide a Default Configuration
3.1 The Code
3.2 Wrapper
3.3 Name
3.4 Namespace
3.5 Description
3.6 URL Directives
4 Master the @include and @exclude Directives
4.1 Matching with or Without the www. Prefix
4.2 Matching All Subdomains of a Site
4.3 Matching Different Top-Level Domains of a Site
4.4 Deciding Between * and http://*
5 Prevent a User Script from Executing
5.1 Disabling a User Script Without Uninstalling It
5.2 Disabling All User Scripts
5.3 Disabling a User Script by Removing All Included Pages
5.4 Disabling a User Script by Excluding All Pages
5.5 Disabling a User Script by Editing config.xml
5.6 Uninstalling a User Script
6 Configure a User Script
6.1 Inline
6.2 During Installation
6.3 After Installation
6.4 Editing Configuration Files
7 Add or Remove Content on a Page
7.1 Adding an Element
7.2 Removing an Element
7.3 Inserting an Element
7.4 Replacing an Element
7.5 Modifying an Element's Attributes
8 Alter a Page's Style
8.1 Adding a Global Style
8.2 Inserting or Removing a Single Style
8.3 Modifying an Element's Style
9 Master XPath Expressions
9.1 Basic Syntax
9.2 Examples
10 Develop a User Script "Live"
10.1 Setting Up File Associations
10.1.1 On Mac OS X.
10.1.2 On Windows.
10.2 The "Live Editing" Development Cycle
11 Debug a User Script
11.1 Check Error Messages
11.2 Log Errors
11.3 Find Page Elements
11.4 Test JavaScript Code Interactively
12 Embed Graphics in a User Script
12.1 The Code
12.2 Running the Hack
13 Avoid Common Pitfalls
13.1 Security Hole #1: Source Code Leakage
13.2 Security Hole #2: API Leakage
13.3 Security Hole #3: Local File Access
13.4 Redesigning from the Ground Up
13.5 Going Deeper
13.6 Pitfall #1: Auto-eval Strings
13.7 Pitfall #2: Event Handlers
13.8 Pitfall #3: Named Forms and Form Elements
13.9 Pitfall #4: Custom Properties
13.10 Pitfall #5: Iterating Collections
13.11 Pitfall #6: scrollIntoView
13.12 Pitfall #7: location
13.13 Pitfall #8: Calling Remote Page Scripts
13.14 Pitfall #9: watch
13.15 Pitfall #10: style
13.16 Conclusion
Hacks 1–12: Introduction
The first thing you need to do to get started with Greasemonkey is install it. Open Firefox and go to http://greasemonkey.mozdev.org. Click the Install Greasemonkey link. Firefox will warn you that it prevented this site from installing software, as shown in Figure 1-1.
Figure 1-1. Firefox, requiring you to whitelist sites to install extensions
Click the Edit Options button to bring up the Allowed Sites dialog, as shown in Figure 1-2.
Figure 1-2. Allowed Sites dialog
Click the Allow button to add the Greasemonkey site to your list of allowed sites; then click OK to dismiss the dialog. Now, click the Install Greasemonkey link again, and Firefox will pop up the Software Installation dialog, as shown in Figure 1-3.
Figure 1-3. Software Installation dialog
Click Install Now to begin the installation process. After it downloads, quit Firefox and relaunch it to finish installing Greasemonkey.
Now that that's out of the way, let's get right to it.
Install a User Script
Greasemonkey won't do anything until you start installing user scripts to customize specific web pages.
A Greasemonkey user script is a single file, written in JavaScript, that customizes one or more web pages. So, before Greasemonkey can start working for you, you need to install a user script.
Tip
Many user scripts are available at the Greasemo
greasemonkey的更多相关文章
- 网络神器Greasemonkey(油猴子)使用方法简介+脚本分享【转载】
推荐下,觉得这个方法有用, 今天艾薇百科来介绍一下功能强大的Greasemonkey,俗称"油猴子",Greasemonkey可以自由定制网页,实现你想要的各种功能.堪称" ...
- 通过Greasemonkey实现网页图片自动点击
昨天受一个朋友所托,实现了一个在特定网页自动点击某超链接图片实现网页跳转功能的JavaScript脚本. 工具就是Firefox的Greasemonkey扩展插件.代码如下: // ==UserScr ...
- GreaseMonkey开发(一):第一个自定义插件Hello GreaseMonkey!
GreaseMonkey最好在火狐浏览器上使用,下载好GreaseMonkey,重启浏览器右上角会出现一只小猴子. 新建一个脚本. 确定,填入代码保存. // ==UserScript== // @n ...
- 按的第一个greasemonkey插件:评论时可以粘贴啦~~
原来的样子:如果按ctrl+V会跳出错误
- greasemonkey修改网页内指定函数
greasemonkey replace function? 方法1:编写GM代码 alert("hello2"); var mydiv =document.getElementB ...
- 火狐浏览器油猴子GreaseMonkey使用教程
火狐浏览器油猴子GreaseMonkey使用教程 首先下载火狐浏览器 安装成功后用火狐浏览器打开链接,界面如下 然后搜索GreaseMonkey. 搜索结果,图标是个小猴子,然后添加到火狐浏览器,成功 ...
- 火狐下的GreaseMonkey和Chrome下的tampermonkey使用手记
说明:GreaseMonkey的作用是让我们浏览器运行我们自己写的脚本,而且是在后台一直不断的运行,听着就让人兴奋. [ps:他们当然可以创建名单对哪些网站作用或者排除哪些站点]: 开始了:Greas ...
- 油猴 greasemonkey 背景音乐 火狐 chrome 背景音乐
火狐,chrome背景音乐 http://www.w3school.com.cn/tags/tag_audio.asp js插入背景音乐,猴油脚本使用 var audio = document.cre ...
- greasemonkey修改网页url
// ==UserScript== // @name JSHE_ModifyFunction // @namespace jshe // @include http://localhost/* // ...
随机推荐
- TouTiao开源项目 分析笔记16 新闻评论
1.要达到的效果 1.1.主要效果图 点击了标题栏的消息图标后,然后会跳转到评论详情的页面. 1.2.触发的点击事件 在新闻详情的片段中的菜单点击事件中 设置上方标题栏的消息标的监听事件 case R ...
- miniui IE对省略号即text-overflow:ellipsis显示不一样的问题
做miniui项目中发现,IE对文本以英文或数字结尾的是英文的省略号,以汉字结尾的就是中文的省略号.只要将字体变为统一宋体即可解决.即 .mini-grid-cell-inner { ...
- python利用PIL库使图片高斯模糊
一.安装PIL PIL是Python Imaging Library简称,用于处理图片.PIL中已经有图片高斯模糊处理类,但有个bug(目前最新的1.1.7bug还存在),就是模糊半径写死的是2,不能 ...
- C++文件操作(转)
C++文件操作(转) 第一个:简单,容易理解,常用:http://www.cnblogs.com/uniqueliu/archive/2011/08/03/2126545.html 第二个:详细的,如 ...
- 抓包工具 - Fiddler - (三)
<转载自 miantest> 我们知道Fiddler是位于客户端和服务器之间的代理,它能够记录客户端和服务器之间的所有 HTTP请求,可以针对特定的HTTP请求,分析请求数据.设置断点.调 ...
- Java基础-7数组
一).什么是数组: 数组是一组具有相同类型和名称的变量集合,把一系列相同类型的数据保存在一起,这些变量称为数组的元素:每个元素都有一个编号,这个编号叫做下标,下标从 0 开始:元素的个数被称为数组的长 ...
- 孤荷凌寒自学python第六十二天学习mongoDB的基本操作并进行简单封装1
孤荷凌寒自学python第六十二天学习mongoDB的基本操作并进行简单封装1 (完整学习过程屏幕记录视频地址在文末) 今天是学习mongoDB数据库的第八天. 今天开始学习mongoDB的简单操作, ...
- shell之ip命令
转:出处我也不知道了,学习时候记下的笔记 1.作用 ip是iproute2软件包里面的一个强大的网络配置工具,它能够替代一些传统的网络管理工具,例如ifconfig.route等,使用权限为超级用户. ...
- Android记事本开发04
昨天: 显式intent 隐身intent 今天: intentFilter 问题: 无法直接预览布局文件的效果.
- Beta
目录 过去存在的问题 任务分工 规范 后端总结 卉卉 家灿 前端总结 绪佩 青元 恺琳 宇恒 丹丹 算法&API接口 家伟 鸿杰 一好 文档&博客撰写 政演 产品功能 我们已经坐了哪些 ...