greasemonkey

run a php script( or anything similar) from greasemonkey/tampermonkey

Deadly 提交于 2019-12-24 04:19:26
问题 I need a way to make a php script that will launch on a certain page load that I do not own. What I want to launch when the page is loaded is a modal that has a login screen. For this to be possible I will need for tampermonkey / greasemonkey to run a php script(or something close to it) that will retrieve information from a sql server. EDIT: I would host my own sql server and users would login/register on to it. They would then use this login to hold their information. 回答1: I'm not really

Use Greasemonkey to remove table

巧了我就是萌 提交于 2019-12-24 01:01:47
问题 I am trying to replace a table with my own table using grease monkey. The page that has the table has 2 tables with the same class and no IDs. I need to replace only the second table (with my own table) and do nothing to the first table. There is nothing that really makes the second table unique from the first table, so the only thing I can think of is trying to add a DIV around the second table, but cant figure it out. Any ideas? Heres the page code: <h3>Table 1</h3> <table class="details"

How to get jQuery ajax calls to work from greasemonkey page events

半世苍凉 提交于 2019-12-24 00:51:55
问题 I have a GM script which inserts a link on to the page, and then adds an event listener for when its clicked. This then runs a function which contains among other things some jQuery.get calls. These calls however do not seem to fire unless I use the unsafeWindow version of jQuery. function runMyFunc() { console.log('myFunc is called'); $.get('index.php',function () { console.log('jQuery.get worked'); }); } $("#someHook").before('<a id="myLink">Link</a>'); $('#myLink').click(runMyFunc); The

Greasemonkey script to append text, to a form, when submitted with AJAX?

主宰稳场 提交于 2019-12-24 00:42:59
问题 So I am making a Greasemonkey script for a mybb forum. What it does is that when you submit a post it adds code to the beginning and the end of the post. Well even though that is a bad explanation just look at the code, it explains itself function form_submit(event) { var form = event ? event.target : this; var arTextareas = form.getElementsByTagName('textarea'); for (var i = arTextareas.length - 1; i >= 0; i--) { var elmTextarea = arTextareas[i]; elmTextarea.value = "[font=Tahoma][color

Clicking a link with greasemonkey from the content inside link

时光怂恿深爱的人放手 提交于 2019-12-23 23:37:23
问题 i have a link that i need to click using greasemonkey <a href="/attack/index/1016587">Attack This Player</a> that is the code the thing is that the href is changeable depending on the page and the only static code is the text of 'attack this player i currently have function click_element(element) { var event = document.createEvent("MouseEvents"); event.initMouseEvent("click", true, true, document.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null); element.dispatchEvent(event);

Greasemonkey debugging, get real line numbers

随声附和 提交于 2019-12-23 23:36:06
问题 I'm trying to get a Greasemonkey Userscript to work but it keeps throwing "missing ; before statement" in the Javascript error console. The Greasemonkey docs say the line number should be ignored but since the script is quite lengthy it would be very helpful to know where the error occurred. How can I find out? Edit: So, long story short. Line numbers are correct in recent Greasemonkey versions. 回答1: The latest editions of Greasemonkey seem to report line numbers adequately, but it is still

Why does changing the innerHTML, of my box, make my button stop working in Greasemonkey?

北战南征 提交于 2019-12-23 22:12:36
问题 So, I wrote a script that loads images one at a time in a new tab... Got a stop button to work thanks to Brock over HERE... Then I broke it adding in the counter that I had written in while waiting for an answer to that question. I can't see any reason that should have broke it... help please? My Script: var box = document.createElement ('div'); box.id = 'mySelectBox'; GM_addStyle ( ' #mySelectBox { ' + ' background: white; ' + ' border: 2px solid red; ' + ' padding: 4px; ' + //' position:

Greasemonkey script to make Fixed Positioned Elements Static

孤者浪人 提交于 2019-12-23 19:40:54
问题 I find elements on a web page that have been positioned fixed to be in my way frequently. I'd like to find a way to disable position: fixed CSS rules in any web site that I visit. I wrote a userscript (Firefox, Greasemonkey) that scans every node in the document and figures out if it has a computed style position fixed, then overrides that to be static. Is there a better way to accomplish my goal? This is the script I wrote, I've narrowed it to just divs for now: Array.forEach( document

How to make greasemonkey open lots of links, in new tabs, one by one?

青春壹個敷衍的年華 提交于 2019-12-23 17:45:45
问题 There are some links which looks like above > <td><a href="http://Lucifase.com/pages/2000.php?refid=2000" > target="_blank">2000</a><br></td> <td><a > href="http://Lucifase.com/pages/3000.php?refid=3000" > target="_blank">3000</a><br></td> <td><a > href="http://Lucifase.com/pages/4000.php?refid=4000" > target="_blank">4000</a><br></td> <td><a > href="http://Lucifase.com/pages/5000.php?refid=5000" > target="_blank">5000</a><br></td> <td><a > href="http://Lucifase.com/pages/6000.php?refid=6000"

On Reddit, how do scripts get the number of upvotes and downvotes for a comment?

≡放荡痞女 提交于 2019-12-23 16:02:29
问题 On Reddit, people can post comments that get upvotes and downvotes. This information is not readily accessible on the page itself, so it seems that something like an API is used to gather this information. I found this script that does this, but am unable to determine where in the script it pulls this information from. Could someone point me to the relevant line where the script gets the data from? 回答1: Each comment has data attributes: <div class="thing id-t1_c4upmtm odd comment " onclick=