tampermonkey

Storing user login/password input in a Greasemonkey script on install

折月煮酒 提交于 2019-12-17 03:43:03
问题 I'm doing a Greasemonkey script that communicates with the Redmine ticket manager through the REST API. As the user needs to login to get the data from Redmine, I need a way to ask the user for his credentials at script installation and save them to the script. Can this be achieved without asking the user to edit the values directly in the script itself? EDIT: Since there is already an answer to this question I will validate the answer given just below as it is a very good framework. 回答1:

Storing user login/password input in a Greasemonkey script on install

五迷三道 提交于 2019-12-17 03:41:37
问题 I'm doing a Greasemonkey script that communicates with the Redmine ticket manager through the REST API. As the user needs to login to get the data from Redmine, I need a way to ask the user for his credentials at script installation and save them to the script. Can this be achieved without asking the user to edit the values directly in the script itself? EDIT: Since there is already an answer to this question I will validate the answer given just below as it is a very good framework. 回答1:

Can a website know if I am running a userscript?

青春壹個敷衍的年華 提交于 2019-12-17 03:34:07
问题 Can, for example, Facebook.com run a version control script on my browser and find out if I am running altered HTML code with the use of a script? Could that be done with a script that can read the HTML code in the cache and produce some kind of hash tag that is sent back to the server and compared with the code that was sent to the client? 回答1: Yes, in theory, a site can deduce the presence of scripts in various situations. This is not foolproof and usually is way too much trouble for the

How do I automatically click this button with tampermonkey?

心已入冬 提交于 2019-12-14 03:33:02
问题 I am wondering how I can make a script that automatically clicks a button with tampermonkey. Here is the button: <button class="confirm" tabindex="1" style="display: inline-block; background-color: rgb(91, 155, 209); box-shadow: rgba(91, 155, 209, 0.8) 0px 0px 2px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px inset;">Next Video</button> 回答1: You can do the following: $(document).ready(function() { $("button:contains('Next Video')").click(); }); Hope that helps! <script src="https://ajax.googleapis.com

Store a persistent list between sessions?

可紊 提交于 2019-12-13 19:09:33
问题 I would like to write a script that allows me to customize a site. To do this I need to have a persistent dictionary. Is this possible with Tampermonkey? EG: persist var mylist = {}; // loads mylist from the HD/cache if it exists, else create a new one. 回答1: See, also, "How/Where to store data in a Chrome Tampermonkey script?". For this, use GM_getValue , GM_setValue , and JSON encoding. EG: var myList = JSON.parse (GM_getValue ("myListArray", null) ) || {}; and GM_setValue ("myListArray",

How to change all links in an ajax driven page?

吃可爱长大的小学妹 提交于 2019-12-13 07:55:05
问题 I have a userscript that modifies the href of all applicable links on an an IP-direct, Google search page: // ==UserScript== // @name _Modify select Google search links // @include http://YOUR_SERVER.COM/YOUR_PATH/* // @include http://62.0.54.118/* // ==/UserScript== var qLinks = document.querySelectorAll ("a[href*='?q=']"); for (var J = qLinks.length - 1; J >= 0; --J) { var oldHref = qLinks[J].getAttribute ('href'); var newHref = oldHref.replace (/\?q=/, "?&q="); //console.log (oldHref + "\n

TamperMonkey can't click button [duplicate]

半腔热情 提交于 2019-12-13 06:21:13
问题 This question already has answers here : How do I get password fields to be autofilled without requiring user interaction? (1 answer) Submit autofill (password input field) (1 answer) Closed last year . This is the website I want to use TamperMonkey to click button. This is my script code: // ==UserScript== // @name click // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://secure.timesheets.com/ // @include https:

Send POST request only if check box is checked

。_饼干妹妹 提交于 2019-12-13 04:26:04
问题 So I'm trying to make my script only log and send the POST request if the check box is checked... The problem is when I un-check the box. It's still sending the post request. This script basically adds check boxes to a specific elements, and gets the ID value if it's checked. Here's my script: const userlist = document.querySelector('#userlist'); new MutationObserver(() => { userlist.querySelectorAll('.user:not([data-has-checkbox])').forEach((userDiv) => { const checkbox = userDiv

Why is this delayed WHILE loop causing a massive memory leak?

北慕城南 提交于 2019-12-13 03:35:15
问题 I ripped a nice trick from somewhere else on this site that allows you to delay the cycles of a loop. I modified it a little for my own use with a Javascript bot that runs on TamperMonkey, in Chrome Version 34.0.1847.131 m. For whatever reason, as soon as the loop is called, a MASSIVE memory leak begins to occur (at about 40,000K - 80,000K per sec) and it doesn't loop at all. My computer already crashed twice because I was neither prepared for nor expecting it. The Function //Tests if Bot is

HTML - Click on button causes list to scroll on top for unknown reasons

我只是一个虾纸丫 提交于 2019-12-12 18:29:25
问题 I am using tampermonkey to add some custom buttons to the Unity Documentation. I noticed a strange problem If I am using a html <button> . Everytime when I click on the button, then the scroll list is scrolling to the top and the code is only executed on the second click. However, If I replace <button> with <div> then everything is working perfectly fine. Why is <button> behaving so weird? Below is the tampermonkey script for reproduction. // ==UserScript== // @name Unity Documentation