greasemonkey

how to enter a random value in a textarea without an id?

别说谁变了你拦得住时间么 提交于 2019-12-31 05:12:20
问题 I have to enter a random value in a textarea of a web site by using grease monkey script the text area didn't have an id so document.getElementById doesn't work. Can I use another method to do that? My current HTML showing my textarea : <tr> <td class="tdv pd5"><span class="tbg"> Message</span> </span> </td> <td class="pd5"> <textarea name="inpx_msg" class="msgbox"></textarea> <br /> <div class="tsm">140 characters max.</div> </td> </tr> 回答1: You could use element.querySelector if you want to

how to enter a random value in a textarea without an id?

半城伤御伤魂 提交于 2019-12-31 05:12:06
问题 I have to enter a random value in a textarea of a web site by using grease monkey script the text area didn't have an id so document.getElementById doesn't work. Can I use another method to do that? My current HTML showing my textarea : <tr> <td class="tdv pd5"><span class="tbg"> Message</span> </span> </td> <td class="pd5"> <textarea name="inpx_msg" class="msgbox"></textarea> <br /> <div class="tsm">140 characters max.</div> </td> </tr> 回答1: You could use element.querySelector if you want to

How to reload only a userscript, i.e. without reloading the page?

ⅰ亾dé卋堺 提交于 2019-12-31 04:09:51
问题 I'm working on a Greasemonkey userscript for a web app that needs configuration steps before I can actually test my userscript's functionality. So every time I reload the page – to refresh my userscript from the updated file –, I have to reconfigure the web app before testing. Needless to say, this gets old very quickly. Is there a way to reload only the userscript , preferably from the userscript itself? I would want to e.g. bind the reload to a keyboard shortcut. I thought that this must be

Userscript to Click a “Refresh” button every minute except when there is input?

蓝咒 提交于 2019-12-31 03:13:22
问题 I'm trying to create a Tampermonkey script that would click the page's "Refresh" button every so often, preferably every minute. It would be even better if it could pause while you are performing other actions on the site like typing but that's more optional. Reason for this is that we are using a website at work that needs us to keep track of incoming customer requests in a timely manner but the site only has an integrated refresh button that needs to be clicked manually and doesn't refresh

Send Global keystroke using JavaScript in FireFox/Greasemonkey

不问归期 提交于 2019-12-31 01:51:07
问题 I currently have a GM script that captures a keystroke and programmatically clicks an element on a webpage. However, this only works when the page/tab has focus. Is there any way to capture the keystroke from the second page/tab and apply the click to an element on the first page/tab? I know I can get a reference to another window by opening it in JavaScript. However, I can't access elements in that window if it is on another domain. If I cannot do this using Greasemonkey, any suggestions on

On-the-fly modifications of the links according to a set of rules (Greasekit / Javascript)

人盡茶涼 提交于 2019-12-30 13:01:52
问题 I have an HTML page with loads of entries like this: <a href="https://www.example.co.uk/gp/wine/product?ie=UTF8&asin=123456789&tab=UK_Default" class="PrmryBtnMed" I want to replace all this links so they instead are: https://www.example.co.uk/gp/wine/order?ie=UTF8&asin=1233456789 So, it's quite a complicated search and replace. These are the instructions for a human: Look at the URL. Only make a note of the number after 'asin='. (Forget everything before that and everything after that) Then,

Add a Date Picker to a textbox using Greasemonkey

两盒软妹~` 提交于 2019-12-30 11:12:38
问题 There is a textbox that requires a date but has no date picker. I would like to add one with Greasemonkey. I looked for an example but could not find one. Is this possible? Is there an example for doing this? It doesn't need to be fancy. 回答1: I like to use jQuery UI's datepicker() because I usually have jQuery UI loaded anyway, and it's fairly well-known/supported. Unfortunately, the datepicker functionality uses some criminally-bad event code, which requires a little fudging to work in a

addEventListener memory leak due to frames

时光总嘲笑我的痴心妄想 提交于 2019-12-30 07:11:28
问题 I have a GreaseMonkey script that works on a site that uses frames as an integral part of its interface. This script leaks memory like a sieve, and I believe it is due to my use of addEventListener within one of the frames. Quite simply, I attach a variety of event listeners, then the frame reloads and I attach the event listeners, and then the frame reloads, around and around for hundreds or possibly thousands of iterations as you interact with various elements in this frame or others. By

Are Chrome user-scripts separated from the global namespace like Greasemonkey scripts?

限于喜欢 提交于 2019-12-30 06:46:12
问题 I know Greasemonkey scripts are automatically wrapped in anonymous functions isolated in some way in order to prevent them conflicting with scripts in the page. Does the same happen with Chrome user-scripts? 回答1: Yes, Greasemonkey scripts are normally wrapped in an anonymous function. And, Chrome userscripts apparently are too. But, more importantly, Greasemonkey scripts are usually 1 wrapped in an XPCNativeWrapper sandbox, while Google Chrome converts userscripts into extensions, and they

How can I change a JavaScript variable using Greasemonkey?

戏子无情 提交于 2019-12-30 05:21:12
问题 This is the page that I am trying to modify, I want to bypass the countdown timer, how should I write the script? Is there a way that I can change the variable document.licenseform.btnSubmit.disabled to yes using Greasemonkey? <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>dsfsdf</title> </head> <body> <form name="licenseform" method="post" action=""> <input name="btnSubmit" type="button" value="我同意"> </form> <SCRIPT language=javascript type=text