greasemonkey

GM_xmlhttpRequest loses data in jQuery .each() statement

萝らか妹 提交于 2019-12-25 07:48:04
问题 I've some pages with URL like this: www.example.com/index.php?id={a number} and each page has the same <select> element: <select id="foo"> <option value="1">Page1 <option value="2">Page2 <option value="3">Page3 <option value="4">Page4 </select> and each page has a <ul> element with different li values: <ul id="other"> <li class="var1">some_value1_page[n]</li> <li class="var2">some_value2_page[n]</li> </ul> The Greasemonkey script takes the <select> element (in any page) and gets the 'id' page

技术宅---我的网上抢火车票攻略

吃可爱长大的小学妹 提交于 2019-12-25 02:03:50
写在前面 写这篇文章的起因是今天在 12306 上买火车票时,被这牛逼的网站给震撼到了,靠,牛叉得让人无语的用户体验啊。就讲讲我是如何利用一个小工具做辅助,幸运地抢到了回家的卧铺票的。希望能给有需要的兄弟们做个参考。 回顾下我今天网上购票的全过程,总结起来有四个难关,第一是登陆,第二是预定,第三是提交订单,第四是支付。本文的目的主要是为了在第一和第二关提供一些帮助。 准备工作: 1 , firefox 浏览器 2 ,油猴脚本扩展 GreaseMonkey (有园友反映这里看不懂啥意思,好吧,特别补充一段。 GreaseMonkey 是一个 firefox 扩展,当然,别再问我啥是扩展了,请自行 google ,简单说,就是装了这个扩展,就可以再它基础上跑一些 js 脚本,对页面做一些修改什么的。。。,) 先去这个页面下载扩展, https://addons.mozilla.org/zh-cn/firefox/addon/greasemonkey/ , 下载到本地的是一个 xpi 文件,将其拖拽进 firefox 里面,就可以完成扩展的安装,重启 firefox 以后就生效,启用了 GreaseMonkey 3 ,去这个页面安装 12306 train ticket buyer 脚本, http://userscripts.org/scripts/show/122334

Get value setted in GM_setValue from a custom Firefox extension

和自甴很熟 提交于 2019-12-25 00:03:36
问题 Do you know if a custom Firefox extension can read values setted calling GM_setValue() from a GraseMonkey user script? 回答1: These values exists in about:config, (enter "greasemonkey" in the filter). Perhaps there exists an easier way to get them, though... 回答2: Since Greasemonkey 1.13 GM_setValue() uses an SQLite db to persist values. This DB can be accessed directly (see https://github.com/greasemonkey/greasemonkey/blob/master/modules/miscapis.js). 来源: https://stackoverflow.com/questions

Problems with Too many connections

三世轮回 提交于 2019-12-24 22:50:46
问题 I am using GM_xmlhttpRequest (greasemonkey xmlhttpRequest) to communicate with my app. Every half second it sends some json to update the status of a page. I am running 3 pages in FireFox. Using netstat -a i got these results. This is over 200 lines. Why am i using so many ports!?! How can i... not do this? and still communicate with my application. NOTE: The 3 pages i am on (example google.com) does not match my domain (localhost) so i am pretty sure a normal xmlhttpRequest will not work (i

Add a dynamic form to specific pages using Greasemonkey and JQuery

回眸只為那壹抹淺笑 提交于 2019-12-24 22:09:52
问题 In a particular forum, clicking the reply button spawns a new window with a text form to type a reply. I want to implement a script to create that specific text form within the main page (instead of spawning a new window). How would I go about doing this? Here is the source code for the pages I want to implement the script on: http://pastebin.com/2UaUVGJA (the main discussion page) http://pastebin.com/hAx2SPUu (the reply page) Here is the attempted script (note that I still need some method

Greasemonkey button click handler not working?

Deadly 提交于 2019-12-24 21:58:56
问题 So, I have this script that will grab the links off of the table on THIS page (the 'x' are links on a logged in users page)... So I'm trying to use a popup loop thing that Brock helped me with for another script... the links get added properly into the 'linksToOpen' array (or did before I added the button, listener and 'openLinksInSequence' function)... everything seems to be fine and I get no error messages... but my button DOESN'T work! // ==UserScript== // @name Unicreatures Accoplishment

Why won't an HTML form load into a Javascript-created iframe?

让人想犯罪 __ 提交于 2019-12-24 16:33:52
问题 So, in pure HTML, I can create a form that loads its results into an iframe (instead of moving the user to the result url). <html> <head> <title>Google Preview</title> <style>iframe { width: 800px; height: 600px }</style> </head> <body> <form method='get' action='http://www.google.com/search' target='results'> <label for='q'>Google Search:</label> <input name='q'/> </form> <!-- form result loads in this iframe --> <iframe name='results'></iframe> </body> </html> I'm trying to do a similar

My Greasemonkey script stopped working after something updated

好久不见. 提交于 2019-12-24 15:25:28
问题 I had made a Greasemonkey script for StumbleUpon , and it worked. But suddenly, maybe after a Mozilla or Scriptish update, it stopped working on all protocols. Please review my script for a mistake. I am a novice in scripting Script: // ==UserScript== // @name [udit]add stumblethru image-flip button[w/o container] on all websites // @namespace testing-for-that-script // @description // @include http://facebook.com/* // @include http://* // @include https://* // @include * // @exclude file:///

Why is my ajaxSuccess jQuery event not being fired in Greasemonkey?

安稳与你 提交于 2019-12-24 15:16:05
问题 I have a basic greasemonkey script shown below, in which I want to run some code every time an AJAX request is sent by the website I'm running the script on. I'm using the ajaxSuccess jQuery handler and it's not being fired. I suspect this might be because the AJAX requests are being sent with the global flag set to false (see http://docs.jquery.com/Ajax_Events). Is there some better way to achieve this that will work even when global is set to false? Code: // ==UserScript== // @name

How to bypass a javascript function using Greasemonkey?

会有一股神秘感。 提交于 2019-12-24 14:34:31
问题 I want to learn how to make a script in Greasemonkey to modify variables in a page or bypass a delaying function. Here is the script found in the middle of the page: <script language="Javascript"> x300=100; function countdown() { x300--; if (x300 == 0) { document.getElementById('countdown').innerHTML = '<strong>Proceed to URL - <a href="http://XXXX.com/11123324">click here</a>!</strong>'; } if (x300 > 0) { document.getElementById('countdown').innerHTML = 'You will be redirected in ' + x300 +