相关疑难解决方法(0)

在Tampermonkey中模拟mousedown,click,mouseup序列?

我想模拟整个点击不仅仅是

document.getElementsByClassName()[0].click();
Run Code Online (Sandbox Code Playgroud)

我怎么做?搜索结果似乎都是关于处理此类事件,而不是触发它们.

javascript greasemonkey mouseevent userscripts tampermonkey

47
推荐指数
3
解决办法
4万
查看次数

在AJAX驱动的站点上选择并激活正确的控件

因此,我每次访问任何nike.com运动鞋页面(没有HTML链接)时都会尝试将其设置在哪里,它会自动选择我的鞋子尺寸,将其添加到购物车中,然后检查我.

我目前正在尝试使用这个脚本(下面),但是每次我去运动鞋页面时,它都没有正确添加我想要的鞋子尺寸,而是直接在我的购物车中没有任何东西结账.

我被告知我需要将代码与实际的页面HTML匹配,但我不知道该怎么做.请帮忙.

// ==UserScript==
// @name     _Nike auto-buy(!!!) script
// @include  http://*/*
// @require  http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @require  https://gist.github.com/raw/2625891/waitForKeyElements.js
// @grant    GM_addStyle
// ==/UserScript==
/*- The @grant directive is needed to work around a design change
    introduced in GM 1.0.   It restores the sandbox.
*/

var okayToClickAddtoCart = false;

//-- Assumes that size is a standard <option> tag or similar...
waitForKeyElements (".selectBox-label[value='10']", selectShoeSize);

function selectShoeSize (jNode) {
    jNode.prop ('selected', true);

    okayToClickAddtoCart = true;
}


waitForKeyElements (".add-to-cart.nike-button", clickAddToCart);

function clickAddToCart (jNode) …
Run Code Online (Sandbox Code Playgroud)

javascript jquery greasemonkey tampermonkey

14
推荐指数
1
解决办法
1万
查看次数

如何制作Greasemonkey单击指定文本的链接?

好吧基本上我想点击一个更改但始终具有相同文本名称的链接.下面是代码可能的示例

<a href="unlock.php?confirm=MD5hashere">Click Here</a>
Run Code Online (Sandbox Code Playgroud)

javascript greasemonkey click hyperlink

10
推荐指数
1
解决办法
1万
查看次数