From what you have described in the, I suspect that anything that meets your criteria will actually just be a Javascript tutorial with some extra Greasemonkey-specific sections / focus
There's not links to many guides and tutorials (might add them in later) but I really think that what you need is a beginner's guide to Javascript such as sections 1-8 (except 5) of the one provided at the Mozilla Developer Network.
Greasemonkey stuff:
Specifically, the Greasemonkey-related topics that you will need to read up on are related to the DOM, altering styles of DOM nodes, and the Greasemonkey API. All else that you need will be generic Javascript that will be specific to the script you are creating.
DOM Manipulation:
Inserting / editing / deleting "nodes" ( in the HTML code) - for example, <a>nchors, <div>s, <img>s
This is how the extra links and tabs etc are added into the page.
Specifically, look into appendChild(), createNode() and insertNodeBefore().
DOM Traversal
Moving around the DOM (HMTL Document) and selecting where to insert the new nodes / selecting which nodes to editor delete.
Specifically, look into XPATH, getElement(s)By_____, parentNode, querySelectorAll()
The basics of changing the CSS of a node are to either use .setAttribute() to set the 'style' attribute, or to alter specific CSS properties using nodeReference.style.cssAttribute = 'value'.
Greasemonkey API
Again, this stuff will be specific to what you want to use within the script you create but the basics include GM_getValue(), GM_setValue(), GM_log()
发布评论
评论(2)
根据您所描述的内容,我怀疑任何符合您标准的内容实际上只是一个 Javascript 教程,其中包含一些额外的 Greasemonkey 特定部分/焦点
没有指向许多指南和教程的链接(可能会在稍后添加它们),但我真的认为您需要一本 Javascript 初学者指南,例如 Mozilla 开发者网络。
Greasemonkey 内容:
具体而言,您需要阅读的与 Greasemonkey 相关的主题与 DOM、更改 DOM 节点的样式以及 Greasemonkey API 相关。您需要的所有其他内容都是特定于您正在创建的脚本的通用 Javascript。
插入/编辑/删除“节点”(在 HTML 代码中) - 例如,
nchors、
s
这是将额外链接和选项卡等添加到页面中的方式。
具体来说,请查看
appendChild()
、createNode()
和insertNodeBefore()
。在 DOM(HMTL 文档)中移动并选择插入新节点的位置/选择要编辑器删除的节点。
具体来说,请查看 XPATH、
getElement(s)By_____
、parentNode
、querySelectorAll()
更改节点 CSS 的基本方法是使用
.setAttribute()
设置“style”属性,或者更改使用nodeReference.style.cssAttribute = 'value'
的特定 CSS 属性。同样,这些内容将特定于您要在创建的脚本中使用的内容,但基础知识包括
GM_getValue()
、GM_setValue(),
GM_log()
From what you have described in the, I suspect that anything that meets your criteria will actually just be a Javascript tutorial with some extra Greasemonkey-specific sections / focus
There's not links to many guides and tutorials (might add them in later) but I really think that what you need is a beginner's guide to Javascript such as sections 1-8 (except 5) of the one provided at the Mozilla Developer Network.
Greasemonkey stuff:
Specifically, the Greasemonkey-related topics that you will need to read up on are related to the DOM, altering styles of DOM nodes, and the Greasemonkey API. All else that you need will be generic Javascript that will be specific to the script you are creating.
Inserting / editing / deleting "nodes" ( in the HTML code) - for example,
<a>
nchors,<div>
s,<img>
sThis is how the extra links and tabs etc are added into the page.
Specifically, look into
appendChild()
,createNode()
andinsertNodeBefore()
.Moving around the DOM (HMTL Document) and selecting where to insert the new nodes / selecting which nodes to editor delete.
Specifically, look into XPATH,
getElement(s)By_____
,parentNode
,querySelectorAll()
The basics of changing the CSS of a node are to either use
.setAttribute()
to set the 'style' attribute, or to alter specific CSS properties usingnodeReference.style.cssAttribute = 'value'
.Again, this stuff will be specific to what you want to use within the script you create but the basics include
GM_getValue()
,GM_setValue()
,GM_log()
看看 Greasemonkey Hacks 已存档,特别是避免常见陷阱 已存档 - 我经常回到后者。
编辑:原始链接已失效,在上标中添加了最近存档版本的链接。
Look at Greasemonkey Hacks archived, especially the part Avoid Common Pitfalls archived - I'm often returning to the latter.
Edit: the original links are dead, added links to recent archived version in superscript.