greasemonkey

window.onload works in Firefox+Greasemonkey script but not in a Chrome userscript?

时光怂恿深爱的人放手 提交于 2019-12-19 06:16:09
问题 There is a page http://example.com/1.php that includes javascript file as usual: <script type="text/javascript" src="/util.js?1354729400"></script> This file contain function named exampleFunction which I need to use in my userscript. Also I have an user script: // ==UserScript== // @name SomeName // @namespace http://example.com/userscripts // @description Greets the world // @include http://example.com/* // ==/UserScript== window.onload = function () { console.log(exampleFunction); alert(

Works as javascript, but doesn't work as a Greasemonkey script?

人走茶凉 提交于 2019-12-19 04:45:08
问题 I'm making a Greasemonkey script to add download links beside videos on cnn.com. I used a saved version of the HTML page to test my script and was able to get it to work perfectly. Then when I put the javascript into Greasemonkey and tried it on the actual site, it didn't work. This is the not the full script, but the part of the script with the problem. It is simply supposed to add a link at the bottom of every div with the "sec_video_box" class (as seen in the picture). // ==UserScript== //

How do I add a userscript installation button to my web page?

本小妞迷上赌 提交于 2019-12-19 04:31:09
问题 I need to host a userscript on an internal company website. How do I build the href so that Greasemonkey will install the userscript when the link is clicked? I tried a simple <a href="user.js">Install Userscript</a> but Chrome and Firefox simply show the file source instead of installing the userscript. 回答1: Your link should look like: <a href="https://example.com/your_script.user.js">Click to install script X</a> <small>(A userscript engine, like Tampermonkey, is required.)</small> In order

Greasemonkey script to work on dynamically loaded posts on Facebook

痞子三分冷 提交于 2019-12-18 18:05:12
问题 I wrote a Greasemonkey script and it affect the firstly loaded posts on Facebook. but after you scroll down on the feed, the script doesn't work on the newly loaded posts. Is there a way to re-run the script for those posts, or something like that? can anyone help me? 回答1: Update: This question and answer are very old and DOMSubtreeModified is deprecated. I no longer recommend this approach. Instead see: Fire Greasemonkey script on AJAX request Run Greasemonkey script on the same page,

How do you make Greasemonkey Click a link that has specified text?

梦想的初衷 提交于 2019-12-18 15:16:56
问题 Alright basically i want to click a link that changes but always has the same text name. Heres an example of what the code might be <a href="unlock.php?confirm=MD5hashere">Click Here</a> 回答1: Here is a starter script that does that. Note that it uses jQuery and assumes you are running Firefox or using Tampermonkey, if you are on Chrome. // ==UserScript== // @name _YOUR_SCRIPT_NAME // @include http://YOUR_SERVER.COM/YOUR_PATH/* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.3

userscript - Add item to right-click menu

无人久伴 提交于 2019-12-18 13:13:03
问题 I am writing a userscript for Greasemonkey and want to add an item to right click context menu. If I'm not mistaken, this function is called window.addEventListener("contextmenu", ...) . Can you give me example of this? 回答1: Following script was copied from http://userscripts-mirror.org/scripts/review/151097: Important warning! This copy is unchanged and untested. There might be security issues with userscripts. GM is very powerful and if used on the wrong page the safety of your computer may

Greasemonkey/Tampermonkey @match for a page with parameters

本小妞迷上赌 提交于 2019-12-18 12:07:50
问题 I'm working on a script that must be executed in a certain page, depending on the parameters it has. The URL is like this: http://example.com/page.php?key1=value1&key2=value2&... And I need to match it when page.php has the key1=value1 among its parameters. Now I'm using @match http://example.com/page.php?key1=value1&* But it doesn't match if page.php has no other parameters. It also won't match if key1 is not the first parameter either. Is there any way to match a page according to a

Rewrite parts of links using Greasemonkey and FireFox

吃可爱长大的小学妹 提交于 2019-12-18 09:06:26
问题 A friend of mine uploaded about 20 or so galleries of nature shots she's done over the past year or so onto webshots.com, however, I just purchased a paid Flickr account for her as a birthday gift, and I want to download all of her photos from webshots and have them ready for her to upload to Flickr once she gets the email about her account upgrade (she's out of the country - no internet access.) I don't have access to her webshots account, so I've resorted to Greasemonkey and DownThemAll to

Tampermonkey to select a dropdown value. It has no ID or name, just a class?

ぃ、小莉子 提交于 2019-12-18 08:57:07
问题 I'm writing a Tampermonkey code for a webpage like ConverTo: It's supposed to automatically select the second option in a dropdown: <select class="format-select"> <option value="mp3">MP3</option> <option value="mp4">MP4 (video)</option> </select> , several seconds after the page is fully loaded. But nothing happens. My code: ...... // @match https://www.converto.io/* // @require http://code.jquery.com/jquery-1.11.0.min.js // ==/UserScript== $(document).ready(function(){ setTimout(test(),10000

Getting requests from a website and retrieving the response?

喜夏-厌秋 提交于 2019-12-18 06:55:05
问题 I am trying to monitor a website (www.bidcactus.com). While on the website I open up Firebug, go to the net tab, and click the XHR tab. I want to take the responses of the requests and save it to a mySql database (I have a local one running on my computer(XAMPP). I have been told to do a variety of things mainly using jQuery or JavaScript but I'm not experienced either so I was wondering if anyone can help me out here. Someone suggested me this link Using Greasemonkey and jQuery to intercept