greasemonkey

How to send data from Greasemonkey to a PHP (WAMP) server?

[亡魂溺海] 提交于 2019-12-12 03:45:27
问题 I am creating a Greasemonkey script where I am calculating six variables (time, move, scroll, sav, prin, book and url). I need to send these variables' data to my PHP page so that these could be inserted in a MySQL table using a WAMP server. Please, can anyone give the exact code to it as I am new to all this? My Greasemonkey script is: {var ajaxDataObj = { s: sav, p: prin, b: book, t: finalTime, u: url, a: totalScroll, b: tot }; var serializedData = JSON.stringify (ajaxDataObj); GM

How to create links from existing text in Greasemonkey? [duplicate]

孤街醉人 提交于 2019-12-12 03:44:57
问题 This question already has answers here : Replace text with link to that text? (2 answers) Closed 7 months ago . I think I'm just having too much trouble understanding how to use regex and creating links... I'm working on a Greasemonkey script for a virtual pet game that will create links to the wiki for each creature listed on a certain page. The problem is, new pets get added to the page all the time so I can't just hardcode the links into the script. I need to search for the creatures names

Saving custom HTML locally on live sites without FTP access?

╄→гoц情女王★ 提交于 2019-12-12 02:46:18
问题 We all know that Firebug / Web Developer Toolbar, etc. can change the HTML/CSS of any page to our local machines. Upon refreshing, however, we know these changes are not saved. How does someone save these changes for just our local machine, in an automatic fashion that would have our changes reappear after refreshing the site? For example, say I go to a blog posting website, which is updated by someone every day. Say I wanted to color the background of every blog's title I've read a bright

How do you edit an HTML <select> element with Greasemonkey?

醉酒当歌 提交于 2019-12-12 02:34:41
问题 There is a Pokemon battle simulator called "Pokemon Showdown". The client is closed source so I can't add a tier to my server. I would like to edit the final battle dropdown to add a tier. I want to change: <select id="lobby-format" onchange="return rooms['lobby'].formSelectFormat()"> <option value="randombattle" selected="selected">Random Battle (rated)</option> <option value="unratedrandombattle">Unrated Random Battle</option> <option value="ou">OU (rated)</option> <option value="cap">CAP

Extract property of a tag in HTML using Javascript

主宰稳场 提交于 2019-12-12 02:17:29
问题 Is it possible to extract properties of a HTML tag using Javascript. For example, I want to know the values present inside with the <div> which has align = "center" . <div align="center">Hello</div> What I know is: var division=document.querySelectorAll("div"); but it selects the elements between <div> & </div> and not the properties inside it. I want to use this in the Greasemonkey script where I can check for some malicious properties of a tag in a website using Javascript . Hope I'm clear.

Split one big table into two tables based on content of third column in each row

眉间皱痕 提交于 2019-12-12 01:43:56
问题 Is it possible to have a script for greasemonkey that will split one table on a page into 2 different tables on the basis of one column? So for example I have table: <table> <tr> <td>Jill</td> <td>Smith</td> <td>Option 1</td> <td>5050</td> </tr> <tr> <td>Eve</td> <td>Jackson</td> <td>Option 2</td> <td>2353</td> </tr> <tr> <td>John</td> <td>Elve</td> <td>Option 1</td> <td>94</td> </tr> </table> And what I want to have as result is: <h2>Table for Option 1</h2> <table> <tr> <td>Jill</td> <td

Remove blankspace from td class with greasemonkey

荒凉一梦 提交于 2019-12-11 19:54:23
问题 If I have webpage with for example alot of <td class="house">111 22</td> . The numbers are random but classname is the same and the blankspace between the numbers are at same position in all of them, and I want to remove the space in all of them after page is loaded. How should the script look like to work? 回答1: How about using this var str = "111 22"; str = str.replace(" ",""); code example : <script type="text/javascript"> //Page Initial $(function() { removeSpace(); }); function

xpath greasemonkey

坚强是说给别人听的谎言 提交于 2019-12-11 19:44:53
问题 I am trying to modify gmail in a greasemonkey script. Using xpather i can get the xpath expression for the part i am trying to hide. But using following snippet i can not get a match. alert function is never called. Can anyone point me to what am i doing wrong? var allLinks, thisLink; allLinks = document.evaluate( "//html/body/div[1]/div/div/div[1]/div/div[3]/div[1]/div[2]/div[2]/div[1]/div[1]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0; i < allLinks

My Greasemonkey script won't install

微笑、不失礼 提交于 2019-12-11 17:55:23
问题 I'm going to write a small Greasemonkey script. Here is my test code: // ==UserScript== // @name test // @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js // @namespace brak // @description test // @include http://forum.php.pl/* // ==/UserScript== $(document).ready(function(){ alert("OK"); }); But it doesn't work. I tried downloading some random script from userscripts.org and it worked when I installed it from the website. But, when I put the source code into script.js

Stop slow-loading script with GreaseMonkey

久未见 提交于 2019-12-11 13:59:08
问题 On a page that I visit, it has a slow-loading external script that occasionally takes so long that the page is basically unusable. Disabling this script entirely removes some functionality, but it's better than nothing. Is there a way I could use greasemonkey to cancel the script? I know I could use NoScript, but I wanted to give it a chance (with a JS timeout). I kind of doubt it (since Greasemonkey doesn't even seem to run scripts until the page has finished loading), but I wanted to check